org.springframework.core.annotation.Order Java Examples
The following examples show how to use
org.springframework.core.annotation.Order.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseWebClientTests.java From spring-cloud-gateway with Apache License 2.0 | 6 votes |
@Bean @Order(500) public GlobalFilter modifyResponseFilter() { return (exchange, chain) -> { log.info("modifyResponseFilter start"); String value = exchange.getAttributeOrDefault(GATEWAY_HANDLER_MAPPER_ATTR, "N/A"); if (!exchange.getResponse().isCommitted()) { exchange.getResponse().getHeaders().add(HANDLER_MAPPER_HEADER, value); } Route route = exchange.getAttributeOrDefault(GATEWAY_ROUTE_ATTR, null); if (route != null) { if (!exchange.getResponse().isCommitted()) { exchange.getResponse().getHeaders().add(ROUTE_ID_HEADER, route.getId()); } } return chain.filter(exchange); }; }
Example #2
Source File: SessionListener.java From webanno with Apache License 2.0 | 6 votes |
@EventListener @Order(Ordered.HIGHEST_PRECEDENCE) public void onSessionCreated(HttpSessionCreatedEvent aEvent) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { log.trace("Session created for anonymous user [{}]", aEvent.getSession().getId()); // We don't register anonymous un-authorized sessions. // If this were a pre-authenticated session, we'd have an authentication by now. // If it is using the form-based login, the login page handles registering the // session. return; } String username = authentication.getName(); log.trace("Session created for user [{}] [{}]", username, aEvent.getSession().getId()); sessionRegistry.registerNewSession(aEvent.getSession().getId(), username); }
Example #3
Source File: JacksonConfig.java From BigDataPlatform with GNU General Public License v3.0 | 6 votes |
@Bean @Order(Ordered.HIGHEST_PRECEDENCE) public Jackson2ObjectMapperBuilderCustomizer customJackson() { return new Jackson2ObjectMapperBuilderCustomizer() { @Override public void customize(Jackson2ObjectMapperBuilder builder) { builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.serializerByType(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.serializerByType(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.deserializerByType(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.serializationInclusion(JsonInclude.Include.NON_NULL); builder.failOnUnknownProperties(false); builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } }; }
Example #4
Source File: JacksonConfig.java From mall with MIT License | 6 votes |
@Bean @Order(Ordered.HIGHEST_PRECEDENCE) public Jackson2ObjectMapperBuilderCustomizer customJackson() { return new Jackson2ObjectMapperBuilderCustomizer() { @Override public void customize(Jackson2ObjectMapperBuilder builder) { builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.serializerByType(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.serializerByType(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.deserializerByType(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.serializationInclusion(JsonInclude.Include.NON_NULL); builder.failOnUnknownProperties(false); builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } }; }
Example #5
Source File: MetaAnnotationUtilsTests.java From spring-analysis-note with MIT License | 6 votes |
@SuppressWarnings("unchecked") private void assertAtComponentOnComposedAnnotationForMultipleCandidateTypes(Class<?> startClass, Class<?> rootDeclaringClass, Class<?> declaringClass, String name, Class<? extends Annotation> composedAnnotationType) { Class<Component> annotationType = Component.class; UntypedAnnotationDescriptor descriptor = findAnnotationDescriptorForTypes( startClass, Service.class, annotationType, Order.class, Transactional.class); assertNotNull("UntypedAnnotationDescriptor should not be null", descriptor); assertEquals("rootDeclaringClass", rootDeclaringClass, descriptor.getRootDeclaringClass()); assertEquals("declaringClass", declaringClass, descriptor.getDeclaringClass()); assertEquals("annotationType", annotationType, descriptor.getAnnotationType()); assertEquals("component name", name, ((Component) descriptor.getAnnotation()).value()); assertNotNull("composedAnnotation should not be null", descriptor.getComposedAnnotation()); assertEquals("composedAnnotationType", composedAnnotationType, descriptor.getComposedAnnotationType()); }
Example #6
Source File: TitusExceptionHandlers.java From titus-control-plane with Apache License 2.0 | 6 votes |
@ExceptionHandler(value = {SchedulerException.class}) @Order(Ordered.HIGHEST_PRECEDENCE) public ResponseEntity<ErrorResponse> handleException(SchedulerException e, WebRequest request) { ErrorResponse.ErrorResponseBuilder errorBuilder = ErrorResponse.newError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()) .clientRequest(request) .serverContext() .exceptionContext(e); switch (e.getErrorCode()) { case InvalidArgument: case SystemSelectorAlreadyExists: case SystemSelectorEvaluationError: errorBuilder.status(HttpServletResponse.SC_BAD_REQUEST); break; case SystemSelectorNotFound: errorBuilder.status(HttpServletResponse.SC_NOT_FOUND); break; default: errorBuilder.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } ErrorResponse errorResponse = errorBuilder.build(); return ResponseEntity.status(errorResponse.getStatusCode()).body(errorResponse); }
Example #7
Source File: BeanFactoryHelperTest.java From eclair with Apache License 2.0 | 6 votes |
@Bean({"two", "two1", "two2"}) @Order(2) public Printer two() { return new Printer() { @Override public boolean supports(Class<?> clazz) { return clazz == String.class; } @Override protected String serialize(Object input) { return "2"; } }; }
Example #8
Source File: ExecutionAutoConfiguration.java From genie with Apache License 2.0 | 6 votes |
/** * Create a {@link ConfigureExecutionStage} bean if one is not already defined. * * @param jobRequestConverter the job request converter * @param jobRequestArguments the job request arguments group * @param runtimeConfigurationArguments the runtime configuration arguments group * @param cleanupArguments the cleanup arguments group */ @Bean @Lazy @Order(30) @ConditionalOnMissingBean(ConfigureExecutionStage.class) ConfigureExecutionStage configureExecutionStage( final JobRequestConverter jobRequestConverter, final ArgumentDelegates.JobRequestArguments jobRequestArguments, final ArgumentDelegates.RuntimeConfigurationArguments runtimeConfigurationArguments, final ArgumentDelegates.CleanupArguments cleanupArguments ) { return new ConfigureExecutionStage( jobRequestConverter, jobRequestArguments, runtimeConfigurationArguments, cleanupArguments ); }
Example #9
Source File: JacksonConfig.java From litemall with MIT License | 6 votes |
@Bean @Order(Ordered.HIGHEST_PRECEDENCE) public Jackson2ObjectMapperBuilderCustomizer customJackson() { return new Jackson2ObjectMapperBuilderCustomizer() { @Override public void customize(Jackson2ObjectMapperBuilder builder) { builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.serializerByType(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.serializerByType(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); builder.deserializerByType(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss"))); builder.serializationInclusion(JsonInclude.Include.NON_NULL); builder.failOnUnknownProperties(false); builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } }; }
Example #10
Source File: GatewayConfig.java From iot-dc3 with Apache License 2.0 | 6 votes |
@Bean @Order(-100) public GlobalFilter globalFilter() { return (exchange, chain) -> { //调用请求之前统计时间 Long startTime = System.currentTimeMillis(); ServerHttpRequest request = exchange.getRequest(); String remoteIp = Objects.requireNonNull(request.getRemoteAddress()).getHostString(); R<Boolean> blackIpValid = blackIpClient.checkBlackIpValid(remoteIp); if (blackIpValid.isOk()) { log.error("Forbidden Ip: {}", remoteIp); exchange.getResponse().setStatusCode(HttpStatus.FORBIDDEN); return exchange.getResponse().setComplete(); } return chain.filter(exchange).then().then(Mono.fromRunnable(() -> { //调用请求之后统计时间 Long endTime = System.currentTimeMillis(); log.info("Remote Ip: {}; Request url: {}; Response code: {}; Time: {}ms", remoteIp, request.getURI().getRawPath(), exchange.getResponse().getStatusCode(), (endTime - startTime)); })); }; }
Example #11
Source File: CacheConfigurationCustomizerEnabledAppendTest.java From camel-spring-boot with Apache License 2.0 | 6 votes |
@Order(Ordered.HIGHEST_PRECEDENCE) @Bean public ComponentCustomizer<EhcacheComponent> customizer() { return new ComponentCustomizer<EhcacheComponent>() { @Override public void customize(EhcacheComponent component) { component.addCachesConfigurations(Collections.singletonMap( CACHE_CONFIG_ID, CacheConfigurationBuilder.newCacheConfigurationBuilder( String.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .heap(2100, EntryUnit.ENTRIES) .offheap(2, MemoryUnit.MB)) .build() )); } }; }
Example #12
Source File: JobsAutoConfiguration.java From genie with Apache License 2.0 | 6 votes |
/** * Create an Job Kickoff Task bean that runs the job. * * @param jobsProperties The various jobs properties * @param executor An instance of an executor * @param genieHostInfo Info about the host Genie is running on * @param registry The metrics registry to use * @param jobDirectoryManifestCreatorService The manifest creation service * @return An application task object */ @Bean @Order(value = 6) @ConditionalOnMissingBean(JobKickoffTask.class) public JobKickoffTask jobKickoffTask( final JobsProperties jobsProperties, final Executor executor, final GenieHostInfo genieHostInfo, final MeterRegistry registry, final JobDirectoryManifestCreatorService jobDirectoryManifestCreatorService ) { return new JobKickoffTask( jobsProperties.getUsers().isRunAsUserEnabled(), jobsProperties.getUsers().isCreationEnabled(), executor, genieHostInfo.getHostname(), registry, jobDirectoryManifestCreatorService ); }
Example #13
Source File: SaveData.java From Cleanstone with MIT License | 6 votes |
@Order(value = 50) @EventListener public void onTerminate(AsyncPlayerTerminationEvent e) { Player player = e.getPlayer(); if (player.getEntity() == null) { return; } EntityData entityData = new EntityData(player.getEntity().getPosition(), player.getEntity().getWorld().getID(), player.getGameMode(), player.isFlying()); try { playerManager.getPlayerDataSource().setPlayerData(player, StandardPlayerDataType.ENTITY_DATA, entityData); } catch (IOException e1) { log.error("Failed to save player data for " + player, e1); } }
Example #14
Source File: SynapseAutoConfiguration.java From synapse with Apache License 2.0 | 5 votes |
/** * Configures a {@link de.otto.synapse.endpoint.MessageInterceptor} that is used to add some default * message headers when messages are received by a {@link de.otto.synapse.endpoint.receiver.MessageReceiverEndpoint}. * * @param synapseProperties properties used to configure the interceptor * @return DefaultReceiverHeadersInterceptor */ @Bean @Order(LOWEST_PRECEDENCE) @ConditionalOnMissingBean @ConditionalOnProperty( prefix = "synapse.receiver.default-headers", name = "enabled", havingValue = "true", matchIfMissing = true) public DefaultReceiverHeadersInterceptor defaultReceiverHeadersInterceptor(final SynapseProperties synapseProperties) { return new DefaultReceiverHeadersInterceptor(synapseProperties); }
Example #15
Source File: GatewayApplication.java From microservice-recruit with Apache License 2.0 | 5 votes |
@Primary @Bean @Order(Ordered.HIGHEST_PRECEDENCE) public ErrorWebExceptionHandler errorWebExceptionHandler(ObjectProvider<List<ViewResolver>> viewResolversProvider, ServerCodecConfigurer serverCodecConfigurer) { ExceptionHandle jsonExceptionHandler = new ExceptionHandle(); jsonExceptionHandler.setViewResolvers(viewResolversProvider.getIfAvailable(Collections::emptyList)); jsonExceptionHandler.setMessageWriters(serverCodecConfigurer.getWriters()); jsonExceptionHandler.setMessageReaders(serverCodecConfigurer.getReaders()); return jsonExceptionHandler; }
Example #16
Source File: AuthorizingHandlerAutoConfiguration.java From hsweb-framework with Apache License 2.0 | 5 votes |
@Bean @Order(Ordered.HIGHEST_PRECEDENCE) public WebMvcConfigurer webUserTokenInterceptorConfigurer(UserTokenManager userTokenManager, AopMethodAuthorizeDefinitionParser parser, List<UserTokenParser> userTokenParser) { return new WebMvcConfigurerAdapter() { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new WebUserTokenInterceptor(userTokenManager, userTokenParser, parser)); super.addInterceptors(registry); } }; }
Example #17
Source File: SecurityConfig.java From syncope with Apache License 2.0 | 5 votes |
@Bean @Order(1) @ConditionalOnProperty(name = AM_TYPE) public SecurityWebFilterChain routesSecurityFilterChain( final ServerHttpSecurity http, final CacheManager cacheManager, final LogoutRouteMatcher logoutRouteMatcher, final PublicRouteMatcher publicRouteMatcher, final CsrfRouteMatcher csrfRouteMatcher, final ConfigurableApplicationContext ctx) { AMType amType = AMType.valueOf(env.getProperty(AM_TYPE)); ServerHttpSecurity.AuthorizeExchangeSpec builder = http.authorizeExchange(). matchers(publicRouteMatcher).permitAll(). anyExchange().authenticated(); switch (amType) { case OIDC: case OAUTH2: OAuth2SecurityConfigUtils.forLogin(http, amType, ctx); OAuth2SecurityConfigUtils.forLogout(builder, amType, cacheManager, logoutRouteMatcher, ctx); break; case SAML2: break; case WA: default: } return builder.and().csrf().requireCsrfProtectionMatcher(csrfRouteMatcher).and().build(); }
Example #18
Source File: PlayerMoveListener.java From Cleanstone with MIT License | 5 votes |
@Order(EventAction.PREVENT) @EventListener public void playerMoveCancellation(PlayerMoveEvent playerMoveEvent) { HeadRotatablePosition oldPosition = playerMoveEvent.getOldPosition(); HeadRotatablePosition newPosition = playerMoveEvent.getNewPosition(); if (oldPosition.equalCoordinates(newPosition)) { return; } double deltaX = (newPosition.getX() * 32 - oldPosition.getX() * 32) * 128; double deltaY = (newPosition.getY() * 32 - oldPosition.getY() * 32) * 128; double deltaZ = (newPosition.getZ() * 32 - oldPosition.getZ() * 32) * 128; if (isTeleport(deltaX, deltaY, deltaZ)) { return; } Player movingPlayer = playerMoveEvent.getPlayer(); int entityID = movingPlayer.getEntity().getEntityID(); float yaw = newPosition.getRotation().getYaw(); float pitch = newPosition.getRotation().getPitch(); int chunkX = newPosition.getXAsInt() >> 4; int chunkZ = newPosition.getZAsInt() >> 4; if (!playerChunkLoadService.hasPlayerLoaded(movingPlayer.getID().getUUID(), ChunkCoords.of(chunkX, chunkZ))) { playerMoveEvent.cancel(); } }
Example #19
Source File: LogEventListener.java From magic-starter with GNU Lesser General Public License v3.0 | 5 votes |
/** * 自定义日志事件处理 * * @param event 事件 */ @Async @Order @EventListener(CustomLogEvent.class) public void handleCustomLogEvent(CustomLogEvent event) { CustomLogModel model = wrapperLogModel(event); logHandler.handleCustomLog(model); }
Example #20
Source File: MsgsMybatisAutoConfiguration.java From zuihou-admin-cloud with Apache License 2.0 | 5 votes |
/** * 数据权限插件 * * @return DataScopeInterceptor */ @Order(10) @Bean @ConditionalOnProperty(prefix = DatabaseProperties.PREFIX, name = "isDataScope", havingValue = "true", matchIfMissing = true) public DataScopeInterceptor dataScopeInterceptor() { return new DataScopeInterceptor((userId) -> SpringUtils.getBean(UserApi.class).getDataScopeById(userId)); }
Example #21
Source File: TaskRelocationExceptionHandler.java From titus-control-plane with Apache License 2.0 | 5 votes |
@ExceptionHandler(value = {RelocationWorkflowException.class}) @Order(Ordered.HIGHEST_PRECEDENCE) protected ResponseEntity<Object> handleRelocationWorkflowException(RelocationWorkflowException ex, WebRequest request) { switch (ex.getErrorCode()) { case NotReady: return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).body("Not ready yet"); case StoreError: default: return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(ex.getMessage()); } }
Example #22
Source File: MetaAnnotationUtilsTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test @SuppressWarnings("unchecked") public void findAnnotationDescriptorForTypesForNonInheritedAnnotationOnInterface() throws Exception { // Note: @Order is not inherited. assertEquals( NonInheritedAnnotationInterface.class, findAnnotationDescriptorForTypes(NonInheritedAnnotationInterface.class, Order.class).getRootDeclaringClass()); assertNull(findAnnotationDescriptorForTypes(SubNonInheritedAnnotationInterface.class, Order.class)); }
Example #23
Source File: ApiBootQuartzAutoConfiguration.java From api-boot with Apache License 2.0 | 5 votes |
@Bean @Order(1) public SchedulerFactoryBeanCustomizer jobDataSourceCustomizer(ApiBootQuartzProperties properties, DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource, ObjectProvider<PlatformTransactionManager> transactionManager) { return (schedulerFactoryBean) -> { if (properties.getJobStoreType() == JobStoreType.JDBC) { DataSource dataSourceToUse = this.getDataSource(dataSource, quartzDataSource); schedulerFactoryBean.setDataSource(dataSourceToUse); PlatformTransactionManager txManager = transactionManager.getIfUnique(); if (txManager != null) { schedulerFactoryBean.setTransactionManager(txManager); } } }; }
Example #24
Source File: WebExternalUIComponentsSource.java From cuba with Apache License 2.0 | 5 votes |
@EventListener @Order(Events.HIGHEST_PLATFORM_PRECEDENCE + 100) public void init(@SuppressWarnings("unused") AppContextInitializedEvent event) { try { // register component from app components _registerAppComponents(); //register components from external component jars _registerComponents("META-INF/cuba-ui-component.xml"); //register components from web modules _registerComponents("cuba-ui-component.xml"); } catch (Exception e) { log.error("Error on custom UI components registration", e); } }
Example #25
Source File: SysUserOnlineListener.java From albedo with GNU Lesser General Public License v3.0 | 5 votes |
@Async @Order @EventListener(SysUserOnlineRefreshLastRequestEvent.class) public void saveSysUserOnlineRefreshLastRequestEvent(SysUserOnlineRefreshLastRequestEvent event) { SessionInformation sessionInformation = (SessionInformation) event.getSource(); UserOnline userOnline = userOnlineService.getById(sessionInformation.getSessionId()); if (userOnline != null) { userOnline.setLastAccessTime(sessionInformation.getLastRequest()); userOnlineService.updateById(userOnline); } else { log.debug("sessionInformation sessionId " + sessionInformation.getSessionId() + ", onlineUser is null"); } }
Example #26
Source File: WebClientBraveTests.java From spring-cloud-sleuth with Apache License 2.0 | 5 votes |
/** * Normally, the HTTP connector would be statically initialized. This ensures the * {@link HttpClient} is configured for the mock endpoint. */ @Bean @Order(0) public WebClientCustomizer clientConnectorCustomizer(HttpClient httpClient, URI baseUrl) { return (builder) -> builder.baseUrl(baseUrl.toString()) .clientConnector(new ReactorClientHttpConnector(httpClient)); }
Example #27
Source File: WorkerConfiguration.java From piper with Apache License 2.0 | 5 votes |
@Bean @Order(Ordered.HIGHEST_PRECEDENCE) TaskHandlerResolver taskDispatcherHandlerAdapterResolver (@Lazy TaskHandlerResolver aResolver, Environment aEnvironment) { return new TaskDispatcherHandlerAdapterResolver(aResolver,SpelTaskEvaluator.builder() .methodExecutor("tempDir", new TempDir()) .environment(aEnvironment) .build()); }
Example #28
Source File: MetaAnnotationUtilsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test @SuppressWarnings("unchecked") public void findAnnotationDescriptorForTypesForClassWithMetaAnnotatedInterface() { Component rawAnnotation = AnnotationUtils.findAnnotation(ClassWithMetaAnnotatedInterface.class, Component.class); UntypedAnnotationDescriptor descriptor = findAnnotationDescriptorForTypes( ClassWithMetaAnnotatedInterface.class, Service.class, Component.class, Order.class, Transactional.class); assertNotNull(descriptor); assertEquals(ClassWithMetaAnnotatedInterface.class, descriptor.getRootDeclaringClass()); assertEquals(Meta1.class, descriptor.getDeclaringClass()); assertEquals(rawAnnotation, descriptor.getAnnotation()); assertEquals(Meta1.class, descriptor.getComposedAnnotation().annotationType()); }
Example #29
Source File: MessageInterceptorBeanPostProcessor.java From synapse with Apache License 2.0 | 5 votes |
private int getOrder(final Method method) { final int order; Order ann = AnnotationUtils.findAnnotation(method, Order.class); if (ann != null) { order = ann.value(); } else { order = LOWEST_PRECEDENCE; } return order; }
Example #30
Source File: JobsAutoConfiguration.java From genie with Apache License 2.0 | 5 votes |
/** * Create an Command Task bean that processes the command needed for a job. * * @param registry The metrics registry to use * @param fts File transfer implementation * @return An command task object */ @Bean @Order(value = 4) @ConditionalOnMissingBean(CommandTask.class) public CommandTask commandProcessorTask( final MeterRegistry registry, @Qualifier("cacheGenieFileTransferService") final GenieFileTransferService fts ) { return new CommandTask(registry, fts); }