本文整理了Java中com.atlassian.plugin.spring.scanner.annotation.export.ExportAsService.
方法的一些代码示例,展示了ExportAsService.
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExportAsService.
方法的具体详情如下:
包路径:com.atlassian.plugin.spring.scanner.annotation.export.ExportAsService
类名称:ExportAsService
方法名:
暂无
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
@ExportAsService
@Named("helpPathResolver")
public class RefImplHelpPathResolver implements HelpPathResolver {
/**
* RefApp doesn't have any specific help available for any plugins.
*/
public HelpPath getHelpPath(String key) {
return null;
}
}
代码示例来源:origin: com.atlassian.plugin/atlassian-spring-scanner-maven-test-service-exporting-plugin
/**
* This export is {@code ComponentImport}ed by the atlassian-spring-scanner-maven-test plugin
*/
@ExportAsService(DynamicallyImportedServiceFromAnotherPlugin.class)
@Component
@SuppressWarnings("unused")
public class DynamicallyImportedServiceFromAnotherPluginImpl implements DynamicallyImportedServiceFromAnotherPlugin {
}
代码示例来源:origin: com.atlassian.plugin/atlassian-spring-scanner-maven-test-service-exporting-plugin
/**
* This export is {@code ComponentImport}ed by the atlassian-spring-scanner-maven-test plugin
*/
@ExportAsService(ServiceTwoExportedFromAnotherPlugin.class)
@Component
@SuppressWarnings("unused")
public class ServiceTwoExportedFromAnotherPluginImpl implements ServiceTwoExportedFromAnotherPlugin {
}
代码示例来源:origin: com.atlassian.plugin/atlassian-spring-scanner-maven-test-service-exporting-plugin
/**
* This export is {@code ComponentImport}ed by the atlassian-spring-scanner-maven-test plugin
*/
@ExportAsService(ServiceExportedFromAnotherPlugin.class)
@Component
@SuppressWarnings("unused")
public class ServiceExportedFromAnotherPluginImpl implements ServiceExportedFromAnotherPlugin {
}
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
/**
* Factory for creating SearchQueries
*/
@ExportAsService
@Named("searchQueryParser")
public class DefaultSearchQueryParser implements SearchQueryParser {
public SearchQuery parse(String query) {
return new DefaultSearchQuery(query);
}
}
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
@Named("salLifecycleManager")
@ExportAsService(LifecycleManager.class)
public class RefimplLifecycleManager extends DefaultLifecycleManager {
public RefimplLifecycleManager(
final PluginEventManager pluginEventManager,
final PluginAccessor pluginAccessor,
final BundleContext bundleContext) {
super(pluginEventManager, pluginAccessor, bundleContext);
}
public boolean isApplicationSetUp() {
return true;
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-core
@Component
@ExportAsService
public class ConnectJwtIssuerRegistry implements JwtIssuerRegistry {
private final ConnectAddonRegistry addonRegistry;
@Autowired
public ConnectJwtIssuerRegistry(@Qualifier("ConnectAddonRegistryMux") ConnectAddonRegistry addonRegistry) {
this.addOnRegistry= addonRegistry;
}
@Nullable
@Override
public JwtIssuer getIssuer(@Nonnull final String issuer) {
return addonRegistry.getSecret(issuer).map((secret) -> new ConnectJwtIssuer(issuer, secret)).orElse(null);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core
/**
* JWT claim provider that injects a "sub" claim and a context user claim when tokens are generated
*/
@Component
@ExportAsService(JwtClaimWriter.class)
public class SubjectJwtClaimWriter implements JwtClaimWriter {
private final UserManager userManager;
@Autowired
public SubjectJwtClaimWriter(UserManager userManager) {
this.userManager = userManager;
}
public void write(@Nonnull JwtJsonBuilder builder) {
JwtUserContextBuilder.addUserContextObject(builder, Optional.ofNullable(userManager.getRemoteUser()));
}
}
代码示例来源:origin: com.atlassian.webhooks/atlassian-webhooks-plugin
@Component
@ExportAsService(WebhookRequestEnricher.class)
public class BuiltInWebhookEnricher implements WebhookRequestEnricher {
@Override
public void enrich(@Nonnull WebhookInvocation invocation) {
invocation.getRequestBuilder()
.header("X-Event-Key", invocation.getEvent().getId())
.header("X-Request-Id", invocation.getId());
}
@Override
public int getWeight() {
return 0;
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-core
/**
* JWT claim provider that injects a "sub" claim and a context user claim when tokens are generated
*/
@Component
@ExportAsService(JwtClaimWriter.class)
public class SubjectJwtClaimWriter implements JwtClaimWriter {
private final UserManager userManager;
@Autowired
public SubjectJwtClaimWriter(UserManager userManager) {
this.userManager = userManager;
}
public void write(@Nonnull JwtJsonBuilder builder) {
JwtUserContextBuilder.addUserContextObject(builder, Optional.ofNullable(userManager.getRemoteUser()));
}
}
代码示例来源:origin: com.atlassian.plugin.automation/jira-automation-spi
@Named
@ExportAsService
public class JiraCronExpressionValidator
{
private final CronExpressionValidator cronExpressionValidator;
@Inject
public JiraCronExpressionValidator(@ComponentImport CronExpressionValidator cronExpressionValidator)
{
this.crOnExpressionValidator= cronExpressionValidator;
}
public boolean isValidExpression(final String expression)
{
return cronExpressionValidator.isValid(expression);
}
}
代码示例来源:origin: com.atlassian.web/atlassian-servlet-plugin
/**
* Rejects multipart requests.
*
* @since 5.1.3
*/
@ExportAsService
@Component
public class MultipartForwardAuthorizer implements ForwardAuthorizer {
public Optional
if (source.getContentType() != null && source.getContentType().toLowerCase().contains("multipart/form-data")) {
return of(false);
} else {
return empty();
}
}
}
代码示例来源:origin: com.atlassian.plugin.automation/jira-automation-spi
@Named
@ExportAsService
public class JiraBuildNumberService implements BuildNumberService
{
private final int applicationBuildNumber;
@Inject
public JiraBuildNumberService(@ComponentImport final BuildUtilsInfo buildUtilsInfo)
{
applicatiOnBuildNumber= buildUtilsInfo.getApplicationBuildNumber();
}
@Override
public long getBuildNumber()
{
return applicationBuildNumber;
}
}
代码示例来源:origin: com.atlassian.webhooks/atlassian-webhooks-plugin
@Component
@ExportAsService({WebhookPayloadProvider.class})
public class DiagnosticsPayloadProvider implements WebhookPayloadProvider {
@Override
public int getWeight() {
return 100000; // very low priority
}
@Override
public void setPayload(@Nonnull WebhookInvocation invocation, @Nonnull WebhookPayloadBuilder builder) {
builder.body("{\"test\": true}".getBytes(StandardCharsets.UTF_8), "application/json");
}
@Override
public boolean supports(@Nonnull WebhookInvocation invocation) {
return invocation.getEvent() == WebhookDiagnosticsEvent.PING;
}
}
代码示例来源:origin: com.atlassian.web/atlassian-servlet-plugin
/**
* Authorizes forwards if they're targeted at host-relative locations.
*
* @since 4.0.0
*/
@ExportAsService
@Component
public class HostForwardAuthorizer implements ForwardAuthorizer {
public Optional
final Optional
if (host.isPresent()) {
return of(false);
} else {
return empty();
}
}
}
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
@ExportAsService
@Named("httpContext")
public class RefImplHttpContext implements HttpContext {
@Override
public HttpServletRequest getRequest() {
return ServletContextThreadLocal.getRequest();
}
@Override
public HttpServletResponse getResponse() {
return ServletContextThreadLocal.getResponse();
}
@Override
public HttpSession getSession(boolean create) {
final HttpServletRequest request = getRequest();
if (request == null)
return null;
return request.getSession(create);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core
@Component
@ExportAsService
public class ConnectJwtIssuerRegistry implements JwtIssuerRegistry {
private final ConnectAddonRegistry addonRegistry;
private final DarkFeatureManager darkFeatureManager;
@Autowired
public ConnectJwtIssuerRegistry(ConnectAddonRegistry addonRegistry, DarkFeatureManager darkFeatureManager) {
this.addOnRegistry= addonRegistry;
this.darkFeatureManager = darkFeatureManager;
}
@Nullable
@Override
public JwtIssuer getIssuer(@Nonnull final String issuer) {
if (!darkFeatureManager.isFeatureEnabledForAllUsers(DelegatingConnectAddonInformationProvider.PLUGIN_SETTINGS_FEATURE_FLAG)) {
return null;
}
return addonRegistry.getSecret(issuer).map((secret) -> new ConnectJwtIssuer(issuer, secret)).orElse(null);
}
}
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
@ExportAsService
@Named("timeZoneManager")
public class RefimplTimeZoneManager implements TimeZoneManager {
@Nonnull
public TimeZone getUserTimeZone() {
return getDefaultTimeZone();
}
@Nonnull
public TimeZone getDefaultTimeZone() {
return TimeZone.getDefault();
}
@Override
@Nonnull
public TimeZone getUserTimeZone(@Nonnull UserKey user) {
Preconditions.checkNotNull(user);
return getDefaultTimeZone();
}
}
代码示例来源:origin: com.atlassian.refapp/atlassian-refapp-sal-plugin
@ExportAsService
@Named("RefimplProjectManager")
public class RefimplProjectManager implements ProjectManager {
private static final String CHARLIE_KEYS = "charlie.keys";
private final PluginSettingsFactory pluginSettingsFactory;
@Inject
public RefimplProjectManager(PluginSettingsFactory pluginSettingsFactory) {
this.pluginSettingsFactory = pluginSettingsFactory;
}
/**
* Get all project keys
*
* @return All the project keys
*/
public Collection
List
if (charlies == null) {
charlies = new ArrayList
}
return charlies;
}
}
代码示例来源:origin: com.adaptavist.arquillian.atlassian/test-plugin-scanner-1
@ExportAsService({MyPluginComponent.class})
@Named("myPluginComponent")
public class MyPluginComponentImpl implements MyPluginComponent {
@ComponentImport
private final ApplicationProperties applicationProperties;
@Inject
public MyPluginComponentImpl(final ApplicationProperties applicationProperties) {
this.applicatiOnProperties= applicationProperties;
}
public String getName() {
if (null != applicationProperties) {
return "myComponent:" + applicationProperties.getDisplayName();
}
return "myComponent";
}
}