@Inject public SingularityLeaderLatch(@Named(SingularityMainModule.HTTP_HOST_AND_PORT) final HostAndPort httpHostAndPort, final CuratorFramework curatorFramework, final Set<LeaderLatchListener> listeners) throws Exception { super(checkNotNull(curatorFramework, "curatorFramework is null"), LEADER_PATH, httpHostAndPort.toString()); checkNotNull(listeners, "listeners is null"); for (LeaderLatchListener listener : listeners) { addListener(listener); } }
@Component("elasticsearch") public class ElasticSearchManaged implements Managed { @Inject @Named("elasticsearch") private SearchEngine searchEngine; @Override public void start() throws Exception { ((ElasticSearchSearchEngine) searchEngine).start(); } @Override public void stop() throws Exception { ((ElasticSearchSearchEngine) searchEngine).stop(); } }
/** * Default implementation for {@link CaptchaConfiguration}. * * @version $Id: 1834827b33ae612bb4fe0369ad395505ca58d4e4 $ * @since 10.8RC1 */ @Component @Singleton public class DefaultCaptchaConfiguration implements CaptchaConfiguration { @Inject @Named("captcha") private ConfigurationSource configuration; @Override public String getDefaultName() { return configuration.getProperty("captcha", "jcaptcha"); } }
@Inject public FindSecurityGroupOrCreate( @Named(TIMEOUT_SECURITYGROUP_PRESENT) Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone, Function<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> groupCreator) { this.returnSecurityGroupExistsInZone = checkNotNull(returnSecurityGroupExistsInZone, "returnSecurityGroupExistsInZone"); this.groupCreator = checkNotNull(groupCreator, "groupCreator"); }
/** * Convenience implementation that delegate to a provided system executor. This * provider will be looked up from the habitat by its type ClusterExecutor and the * "target" name. */ @Service public final class TargetBasedExecutor implements ClusterExecutor { @Inject @Named("GlassFishClusterExecutor") private ClusterExecutor delegate=null; @Override public ActionReport.ExitCode execute(String commandName, AdminCommand command, AdminCommandContext context, ParameterMap parameters) { return delegate.execute(commandName, command, context, parameters); } }
/** * Default implementation for {@link PrincipalsResource} using XWiki's support for REST resources. * * @version $Id: dffc755590fda97243ae5c02ff8762656c597f74 $ * @since 1.4 */ @Component @Named("org.phenotips.users.rest.internal.DefaultPrincipalsResourceImpl") @Singleton public class DefaultPrincipalsResourceImpl extends XWikiResource implements PrincipalsResource { @Inject private UsersAndGroups usersAndGroups; @Override public Response getAllUsersAndGroups() { JSONObject json = this.usersAndGroups.getAll(); return Response.ok(json, MediaType.APPLICATION_JSON_TYPE).build(); } }
@Inject public BucketsToStorageMetadata(@Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, BucketToResourceMetadata bucket2ResourceMd) { this.userExecutor = checkNotNull(userExecutor, "userExecutor"); this.bucket2ResourceMd = checkNotNull(bucket2ResourceMd, "bucket2ResourceMd"); }
/** * Convenience implementation that delegate to a provided system executor. This * provider will be looked up from the habitat by its type ClusterExecutor and the * "target" name. */ @Service public final class TargetBasedExecutor implements ClusterExecutor { @Inject @Named("GlassFishClusterExecutor") private ClusterExecutor delegate=null; @Override public ActionReport.ExitCode execute(String commandName, AdminCommand command, AdminCommandContext context, ParameterMap parameters) { return delegate.execute(commandName, command, context, parameters); } }
/** * Provides instance-specific scripting APIs. * * @version $Id: 014cc515d7d7980343ad71d9916d6e2f1f980c5b $ * @since 8.3RC1 */ @Component @Named("instance") @Singleton public class InstanceScriptService implements ScriptService { @Inject private InstanceIdManager instanceIdManager; /** * @return the XWiki instance id or null if not set, see {@link InstanceIdManager#getInstanceId()} */ public InstanceId getInstanceId() { return instanceIdManager.getInstanceId(); } }
@Inject VAppTemplatesSupplier(Supplier<Map<String, Org>> orgMap, Function<Org, Iterable<VAppTemplate>> imagesInOrg, @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor) { this.orgMap = checkNotNull(orgMap, "orgMap"); this.imagesInOrg = checkNotNull(imagesInOrg, "imagesInOrg"); this.userExecutor = checkNotNull(userExecutor, "userExecutor"); }
@Inject public ClusterDeflectorResource(@Context HttpHeaders httpHeaders, NodeService nodeService, RemoteInterfaceProvider remoteInterfaceProvider, @Named("proxiedRequestsExecutorService") ExecutorService executorService) { super(httpHeaders, nodeService, remoteInterfaceProvider, executorService); }