Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fd4b1b9
ATLASSIAN update tests for Java 17
mtokarski-atlassian Nov 12, 2024
034fa0e
ATLASSIAN remove Equinox test configuration - we care only about Felix
mtokarski-atlassian Nov 12, 2024
8c23507
ATLASSIAN add integration-tests module to default execution - disable…
mtokarski-atlassian Nov 12, 2024
5f84b62
ATLASSIAN remove Knopflerfish test configuration - we care only about…
mtokarski-atlassian Nov 12, 2024
11a6edd
Merged in issue/main/DCPL-1771-fix-tests-on-java-17 (pull request #2)
mtokarski-atlassian Nov 13, 2024
601b6cc
DCPL-1771 update project's version
mtokarski-atlassian Nov 13, 2024
56661a4
DCPL-1771 update project's SCM coords
mtokarski-atlassian Nov 13, 2024
ee68bb9
Merged in issue/main/DCPL-1771-update-projects-version (pull request #3)
mtokarski-atlassian Nov 13, 2024
a05e7af
DCPL-1771 compile to Java 17
mtokarski-atlassian Nov 13, 2024
3cf65b4
DCPL-1771 use Felix profile by default
mtokarski-atlassian Nov 13, 2024
c76a864
DCPL-1771 update to recent Felix and OSGi versions
mtokarski-atlassian Nov 13, 2024
9a82ea4
DCPL-1771 enable integration tests
mtokarski-atlassian Nov 13, 2024
cc1b95a
Merged in issue/main/DCPL-1771-enable-integration-tests (pull request…
mtokarski-atlassian Nov 13, 2024
16cf642
DCPL-1771 update to Spring 6
mtokarski-atlassian Nov 13, 2024
7acdafc
ATLASSIAN update `Assert` calls to removed methods
mtokarski-atlassian Dec 21, 2023
c612ee6
ATLASSIAN remove `SecurityManager` related code and all remaining com…
mtokarski-atlassian Dec 21, 2023
4f3bd18
DCPL-1771 fix all the tests after update to Spring 6
mtokarski-atlassian Nov 13, 2024
f8be4e3
Merged in issue/main/DCPL-1771-upgrade-to-Spring-6 (pull request #5)
mtokarski-atlassian Nov 18, 2024
209801a
DCPL-1771 remove obsolete config elements around releasing
mtokarski-atlassian Nov 18, 2024
cf8c0e5
DCPL-1771 point to Atlassian Maven repository
mtokarski-atlassian Nov 18, 2024
76bba89
[maven-release-plugin] prepare release gemini-blueprint-4.0.0-atlassi…
Nov 18, 2024
f5db7ef
[maven-release-plugin] prepare for next development iteration
Nov 18, 2024
8ff0527
DCPL-1771 copy license file to every jar
mtokarski-atlassian Nov 18, 2024
7b69cb2
DCPL-1771 add snapshot repository configuration
mtokarski-atlassian Nov 18, 2024
bafca00
DCPL-1771 ensure javadoc is produced
mtokarski-atlassian Nov 18, 2024
6994fd4
DCPL-1771 fix test after config update
mtokarski-atlassian Nov 18, 2024
8f4f941
[maven-release-plugin] prepare release gemini-blueprint-4.0.0-atlassi…
Nov 18, 2024
b2d7ea9
[maven-release-plugin] prepare for next development iteration
Nov 18, 2024
7315ba7
Merged in issue/main/DCPL-1771-provide-release-configuration (pull re…
mtokarski-atlassian Nov 18, 2024
7fec30c
[maven-release-plugin] prepare release 4.0.0-atlassian-3
Nov 18, 2024
c8146b8
[maven-release-plugin] prepare for next development iteration
Nov 18, 2024
b7047e7
DCPL-1868 use proper Platform 8 / Jakarta milestone
mtokarski-atlassian Nov 28, 2024
ec70335
DCPL-1868 use latest Spring 6.2
mtokarski-atlassian Nov 28, 2024
c9f47a1
DCPL-1868 fix regression from Spring around proxy creation
mtokarski-atlassian Nov 28, 2024
1c17c60
Merged in issue/main/DCPL-1868-use-proper-milestone (pull request #7)
mtokarski-atlassian Nov 28, 2024
6a97705
[maven-release-plugin] prepare release 4.0.0-atlassian-4
Nov 28, 2024
2f2aab2
[maven-release-plugin] prepare for next development iteration
Nov 28, 2024
e97efd1
BSP-6459: Added filter for console logback config
okarabush Jan 7, 2025
2be5258
Merged in issue/main/BSP-6459-decrease-log-size (pull request #8)
okarabush Jan 7, 2025
16a78c6
DCPL update repository URL
mtokarski-atlassian Feb 13, 2025
07bb0fc
update javadoc version to be jdk17 compatible and suppress errors
AppyS23 Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>gemini-blueprint</artifactId>
<groupId>org.eclipse.gemini.blueprint</groupId>
<version>3.0.0.M01-SNAPSHOT</version>
<version>4.0.0-atlassian-5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -36,43 +36,38 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-aop</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-beans</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-context</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-expression</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-test</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

package org.eclipse.gemini.blueprint.blueprint.container;

import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.eclipse.gemini.blueprint.blueprint.container.support.BlueprintEditorRegistrar;
import org.eclipse.gemini.blueprint.context.support.internal.security.SecurityUtils;
import org.osgi.service.blueprint.container.Converter;
import org.osgi.service.blueprint.container.ReifiedType;
import org.springframework.beans.SimpleTypeConverter;
Expand Down Expand Up @@ -93,19 +89,7 @@ public Object convert(final Object source, TypeDescriptor sourceType, TypeDescri
return source;

final ReifiedType type = TypeFactory.getType(targetType);
boolean hasSecurity = (System.getSecurityManager() != null);
AccessControlContext acc = (hasSecurity ? SecurityUtils.getAccFrom(cbf) : null);
Object result;

if (hasSecurity) {
result = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
return doConvert(source, type);
}
}, acc);
} else {
result = doConvert(source, type);
}
Object result = doConvert(source, type);

if (result != null) {
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

package org.eclipse.gemini.blueprint.blueprint.container.support;

import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Dictionary;
import java.util.Hashtable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.gemini.blueprint.context.support.internal.security.SecurityUtils;
import org.eclipse.gemini.blueprint.util.OsgiBundleUtils;
import org.eclipse.gemini.blueprint.util.OsgiServiceUtils;
import org.osgi.framework.Bundle;
Expand Down Expand Up @@ -100,18 +96,7 @@ private void registerService(ApplicationContext applicationContext) {
if (log.isDebugEnabled())
log.debug("Publishing service under classes " + ObjectUtils.nullSafeToString(serviceNames));

AccessControlContext acc = SecurityUtils.getAccFrom(applicationContext);

// publish service
if (System.getSecurityManager() != null) {
registration = AccessController.doPrivileged(new PrivilegedAction<ServiceRegistration>() {
public ServiceRegistration run() {
return bundleContext.registerService(serviceNames, blueprintContainer, serviceProperties);
}
}, acc);
} else {
registration = bundleContext.registerService(serviceNames, blueprintContainer, serviceProperties);
}
registration = bundleContext.registerService(serviceNames, blueprintContainer, serviceProperties);
}

private void unregisterService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class UpdateMethodAdapter {
* @return
*/
static Map determineUpdateMethod(final Class<?> target, final String methodName) {
Assert.notNull(target);
Assert.notNull(methodName);
Assert.notNull(target, "required field");
Assert.notNull(methodName, "required field");

final Map methods = new LinkedHashMap(2);
final boolean trace = log.isTraceEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected AbstractBeanDefinition parseInternal(Element element, ParserContext pa
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();

Class<?> beanClass = getBeanClass(element);
Assert.notNull(beanClass);
Assert.notNull(beanClass, "required field");

if (beanClass != null) {
builder.getRawBeanDefinition().setBeanClass(beanClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class OsgiDefaultsDefinition {
private Availability availability = Availability.MANDATORY;

public OsgiDefaultsDefinition(Document document, ParserContext parserContext) {
Assert.notNull(document);
Assert.notNull(document, "required field");
Element root = document.getDocumentElement();

ReferenceParsingUtil.checkAvailabilityAndCardinalityDuplication(root, DEFAULT_AVAILABILITY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static Map<Class<?>, List<Method>> determineCustomMethods(final Class<?> target,
return Collections.emptyMap();
}

Assert.notEmpty(possibleArgumentTypes);
Assert.notEmpty(possibleArgumentTypes, "required field");

if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedAction<Map<Class<?>, List<Method>>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
package org.eclipse.gemini.blueprint.config.internal.adapter;

import java.lang.reflect.Method;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.gemini.blueprint.context.support.internal.security.SecurityUtils;
import org.eclipse.gemini.blueprint.service.importer.ImportedOsgiServiceProxy;
import org.eclipse.gemini.blueprint.service.importer.OsgiServiceLifecycleListener;
import org.eclipse.gemini.blueprint.util.internal.ReflectionUtils;
Expand Down Expand Up @@ -80,7 +75,7 @@ public class OsgiServiceLifecycleListenerAdapter implements OsgiServiceLifecycle
private boolean initialized;

public void afterPropertiesSet() {
Assert.notNull(beanFactory);
Assert.notNull(beanFactory, "required field");
Assert.isTrue(target != null || StringUtils.hasText(targetBeanName),
"one of 'target' or 'targetBeanName' properties has to be set");

Expand Down Expand Up @@ -113,20 +108,11 @@ private void initialize() {

bindMethods = CustomListenerAdapterUtils.determineCustomMethods(clazz, bindMethod, isBlueprintCompliant);

boolean isSecurityEnabled = System.getSecurityManager() != null;
final Class<?> clz = clazz;

// determine methods using ServiceReference signature
if (StringUtils.hasText(bindMethod)) {
if (isSecurityEnabled) {
bindReference = AccessController.doPrivileged(new PrivilegedAction<Method>() {
public Method run() {
return findServiceReferenceMethod(clz, bindMethod);
}
});
} else {
bindReference = findServiceReferenceMethod(clz, bindMethod);
}
bindReference = findServiceReferenceMethod(clz, bindMethod);

if (bindMethods.isEmpty()) {
String beanName = (target == null ? "" : " bean [" + targetBeanName + "] ;");
Expand All @@ -138,15 +124,7 @@ public Method run() {
unbindMethods = CustomListenerAdapterUtils.determineCustomMethods(clazz, unbindMethod, isBlueprintCompliant);

if (StringUtils.hasText(unbindMethod)) {
if (isSecurityEnabled) {
unbindReference = AccessController.doPrivileged(new PrivilegedAction<Method>() {
public Method run() {
return findServiceReferenceMethod(clz, unbindMethod);
}
});
} else {
unbindReference = findServiceReferenceMethod(clz, unbindMethod);
}
unbindReference = findServiceReferenceMethod(clz, unbindMethod);

if (unbindMethods.isEmpty()) {
String beanName = (target == null ? "" : " bean [" + targetBeanName + "] ;");
Expand Down Expand Up @@ -227,29 +205,13 @@ public void bind(final Object service, final Map properties) throws Exception {
if (!initialized)
retrieveTarget();

boolean isSecurityEnabled = (System.getSecurityManager() != null);
AccessControlContext acc = null;

if (isSecurityEnabled) {
acc = SecurityUtils.getAccFrom(beanFactory);
}

// first call interface method (if it exists)
if (isLifecycleListener) {
if (trace)
log.trace("Invoking listener interface methods");

try {
if (isSecurityEnabled) {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
((OsgiServiceLifecycleListener) target).bind(service, properties);
return null;
}
}, acc);
} else {
((OsgiServiceLifecycleListener) target).bind(service, properties);
}
((OsgiServiceLifecycleListener) target).bind(service, properties);
} catch (Exception ex) {
if (ex instanceof PrivilegedActionException) {
ex = ((PrivilegedActionException) ex).getException();
Expand All @@ -258,18 +220,8 @@ public Object run() throws Exception {
}
}

if (isSecurityEnabled) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
CustomListenerAdapterUtils.invokeCustomMethods(target, bindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, bindReference, service);
return null;
}
}, acc);
} else {
CustomListenerAdapterUtils.invokeCustomMethods(target, bindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, bindReference, service);
}
CustomListenerAdapterUtils.invokeCustomMethods(target, bindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, bindReference, service);
}

public void unbind(final Object service, final Map properties) throws Exception {
Expand All @@ -281,45 +233,19 @@ public void unbind(final Object service, final Map properties) throws Exception
log.trace("Invoking unbind method for service " + ObjectUtils.identityToString(service) + " with props="
+ properties);

boolean isSecurityEnabled = (System.getSecurityManager() != null);
AccessControlContext acc = null;

if (isSecurityEnabled) {
acc = SecurityUtils.getAccFrom(beanFactory);
}

// first call interface method (if it exists)
if (isLifecycleListener) {
if (trace)
log.trace("Invoking listener interface methods");
try {
if (isSecurityEnabled) {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
((OsgiServiceLifecycleListener) target).unbind(service, properties);
return null;
}
}, acc);
} else {
((OsgiServiceLifecycleListener) target).unbind(service, properties);
}
((OsgiServiceLifecycleListener) target).unbind(service, properties);
} catch (Exception ex) {
log.warn("Standard unbind method on [" + target.getClass().getName() + "] threw exception", ex);
}
}

if (isSecurityEnabled) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
CustomListenerAdapterUtils.invokeCustomMethods(target, unbindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, unbindReference, service);
return null;
}
}, acc);
} else {
CustomListenerAdapterUtils.invokeCustomMethods(target, unbindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, unbindReference, service);
}
CustomListenerAdapterUtils.invokeCustomMethods(target, unbindMethods, service, properties);
invokeCustomServiceReferenceMethod(target, unbindReference, service);
}

/**
Expand Down
Loading