forked from eclipse-hawkbit/hawkbit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-hawkbit#169 from bsinno/fix_forbidden_exce…
…ption_after_login run getting polling configuration in system-code
- Loading branch information
Showing
5 changed files
with
91 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...rc/main/java/org/eclipse/hawkbit/repository/model/helper/SystemSecurityContextHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.hawkbit.repository.model.helper; | ||
|
||
import org.eclipse.hawkbit.security.SystemSecurityContext; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
/** | ||
* A singleton bean which holds {@link SystemSecurityContext} service and makes | ||
* it accessible to beans which are not managed by spring, e.g. JPA entities. | ||
*/ | ||
public final class SystemSecurityContextHolder { | ||
|
||
private static final SystemSecurityContextHolder INSTANCE = new SystemSecurityContextHolder(); | ||
|
||
@Autowired | ||
private SystemSecurityContext systemSecurityContext; | ||
|
||
private SystemSecurityContextHolder() { | ||
} | ||
|
||
/** | ||
* @return the singleton {@link SystemSecurityContextHolder} instance | ||
*/ | ||
public static SystemSecurityContextHolder getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
/** | ||
* @return the {@link SystemSecurityContext} service | ||
*/ | ||
public SystemSecurityContext getSystemSecurityContext() { | ||
return systemSecurityContext; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters