本文整理汇总了Java中com.atlassian.jira.component.ComponentAccessor.getOSGiComponentInstanceOfType方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentAccessor.getOSGiComponentInstanceOfType方法的具体用法?Java ComponentAccessor.getOSGiComponentInstanceOfType怎么用?Java ComponentAccessor.getOSGiComponentInstanceOfType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.atlassian.jira.component.ComponentAccessor
的用法示例。
在下文中一共展示了ComponentAccessor.getOSGiComponentInstanceOfType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkWebSudo
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
protected boolean checkWebSudo(final HttpServletRequest req, final HttpServletResponse resp) {
if (!isWebSudoNecessary()) {
return true;
}
WebSudoManager webSudoManager =
ComponentAccessor.getOSGiComponentInstanceOfType(WebSudoManager.class);
if (!webSudoManager.canExecuteRequest(req)) {
if ("XMLHttpRequest".equals(req.getHeader("X-Requested-With"))) {
webSudoManager.enforceWebSudoProtection(req, new AjaxRedirectCatchServletResponse(resp));
} else {
webSudoManager.enforceWebSudoProtection(req, resp);
}
return false;
}
return true;
}
示例2: getProjectJamTimestamp
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public static Long getProjectJamTimestamp(Project project) {
AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
ActiveObjects activeObjects = aoWrapper.getActiveObjects();
JamPluginTimestamp[] mappings = activeObjects.find(JamPluginTimestamp.class, "PROJECT_ID = ?", project.getId());
if ( mappings.length > 0) {
return mappings[0].getJamTimestamp();
}
Long now = System.currentTimeMillis();
activeObjects.create(
JamPluginTimestamp.class,
new DBParam("JAM_TIMESTAMP", now),
new DBParam("PROJECT_ID", project.getId())
);
return now;
}
示例3: AbstractPageServlet
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
/**
* Initializes the compiled page template.
*/
public AbstractPageServlet() {
try {
querydslSupport = new QuerydslSupportImpl();
} catch (Exception e) {
throw new RuntimeException(e);
}
transactionTemplate =
ComponentAccessor.getOSGiComponentInstanceOfType(TransactionTemplate.class);
ClassLoader classLoader = this.getClass().getClassLoader();
pageTemplate = new LocalizedTemplate(getTemplateBase(), classLoader);
}
示例4: ServiceProvider
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private ServiceProvider(final String clientID, final String clientSecret, final String providerID, final String x509Cert, final PublicKey publicKey)
{
this.clientID = clientID;
this.clientSecret = clientSecret;
this.providerID = providerID;
this.publicKey = publicKey;
this.x509Cert = x509Cert;
AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
activeObjects = aoWrapper.getActiveObjects();
}
示例5: JamConsumer
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private JamConsumer(final ApplicationLink applicationLink, final String clientID, final String providerID, final X509Certificate certificate, final PrivateKey privateKey, final String certificateString, final String privateKeyString)
{
this.applicationLink = applicationLink;
this.tokenURL = applicationLink.getRpcUrl().toString() + ACCESS_TOKEN_URL;
this.clientID = clientID;
this.providerID = providerID;
this.certificate = certificate;
this.privateKey = privateKey;
this.certificateString = certificateString;
this.privateKeyString = privateKeyString;
AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
activeObjects = aoWrapper.getActiveObjects();
}
示例6: JamClient
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public JamClient(ApplicationLinkService applicationLinkService,
HostApplication hostApplication,
IssueManager issueManager) {
this.applicationLinkService = applicationLinkService;
this.hostApplication = hostApplication;
this.issueManager = issueManager;
jamLink = this.applicationLinkService.getPrimaryApplicationLink(JamApplicationType.class);
jiraODataURL = this.hostApplication.getBaseUrl().toString() + "/plugins/servlet/sapjam/api/OData/";
AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
activeObjects = aoWrapper.getActiveObjects();
i18n = new I18nBean();
}
示例7: authenticate
import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private void authenticate(HttpServletRequest request) throws ODataException
{
final String authorization = request.getHeader("Authorization");
if (authorization != null && authorization.startsWith("Bearer "))
{
String token = authorization.substring("Bearer".length()).trim();
// Initialize JIRA services
AuthenticationConfigurationManager authenticationConfigurationManager = ComponentAccessor.getOSGiComponentInstanceOfType(AuthenticationConfigurationManager.class);
ApplicationLinkService applicationLinkService = ComponentAccessor.getOSGiComponentInstanceOfType(ApplicationLinkService.class);
JamConsumerProviderStore jamConsumerProviderStore = new JamConsumerProviderStore(authenticationConfigurationManager);
ServiceProvider jamServiceProvider = jamConsumerProviderStore.getServiceProvider(applicationLinkService.getPrimaryApplicationLink(JamApplicationType.class));
if ( jamServiceProvider != null )
{
OAuth2Token jamToken = jamServiceProvider.getTokenFromBearerToken(token);
if ( jamToken != null ) {
User user = ComponentAccessor.getUserUtil().getUserObject(jamToken.getUsername());
if ( user != null ) {
// Set the current user context to this user!
ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(user);
return;
}
}
}
}
throw new ODataUnauthorizedException();
}