-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Spring Cleanup] Remove Spring dependencies in the CORS management API (
#693) * Remove Spring dependencies in the CORS management API * Resolve PR comments
- Loading branch information
1 parent
10e454c
commit 9fdcf77
Showing
10 changed files
with
170 additions
and
184 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
53 changes: 21 additions & 32 deletions
53
...mmon/src/main/java/org/wso2/carbon/identity/api/server/cors/common/CORSServiceHolder.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 |
---|---|---|
@@ -1,56 +1,45 @@ | ||
/* | ||
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.api.server.cors.common; | ||
|
||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.cors.mgt.core.CORSManagementService; | ||
|
||
/** | ||
* Service holder class for server configuration related services. | ||
*/ | ||
public class CORSServiceHolder { | ||
|
||
private static CORSServiceHolder instance = new CORSServiceHolder(); | ||
|
||
private CORSManagementService corsManagementService; | ||
|
||
private CORSServiceHolder() {} | ||
|
||
public static CORSServiceHolder getInstance() { | ||
|
||
return instance; | ||
private static class CORSManagementServiceHolder { | ||
static final CORSManagementService SERVICE = (CORSManagementService) PrivilegedCarbonContext | ||
.getThreadLocalCarbonContext().getOSGiService(CORSManagementService.class, null); | ||
} | ||
|
||
/** | ||
* Get CORSManagementService osgi service. | ||
* | ||
* @return CORSManagementService | ||
*/ | ||
public CORSManagementService getCorsManagementService() { | ||
|
||
return CORSServiceHolder.getInstance().corsManagementService; | ||
} | ||
|
||
/** | ||
* Set CORSManagementService osgi service. | ||
* | ||
* @param corsManagementService CORSManagementService. | ||
*/ | ||
public void setCorsManagementService(CORSManagementService corsManagementService) { | ||
public static CORSManagementService getCorsManagementService() { | ||
|
||
CORSServiceHolder.getInstance().corsManagementService = corsManagementService; | ||
return CORSManagementServiceHolder.SERVICE; | ||
} | ||
} |
51 changes: 0 additions & 51 deletions
51
...va/org/wso2/carbon/identity/api/server/cors/common/factory/CORSMgtOGSiServiceFactory.java
This file was deleted.
Oops, something went wrong.
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
42 changes: 26 additions & 16 deletions
42
...gen/java/org/wso2/carbon/identity/api/server/cors/v1/factories/CorsApiServiceFactory.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 |
---|---|---|
@@ -1,30 +1,40 @@ | ||
/* | ||
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
* Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.api.server.cors.v1.factories; | ||
|
||
import org.wso2.carbon.identity.api.server.cors.v1.CorsApiService; | ||
import org.wso2.carbon.identity.api.server.cors.v1.impl.CorsApiServiceImpl; | ||
|
||
/** | ||
* Factory class for Cors API. | ||
*/ | ||
public class CorsApiServiceFactory { | ||
|
||
private final static CorsApiService service = new CorsApiServiceImpl(); | ||
private final static CorsApiService SERVICE = new CorsApiServiceImpl(); | ||
|
||
/** | ||
* Get Cors API Service. | ||
* | ||
* @return CorsApiService | ||
*/ | ||
public static CorsApiService getCorsApi() | ||
{ | ||
return service; | ||
return SERVICE; | ||
} | ||
} |
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
Oops, something went wrong.