You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2018/01/31 20:10:04 UTC
svn commit: r1822826 [1/4] - in /aries/trunk/blueprint:
blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/
blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/
blueprint-core/src/main/java/org/apache/aries/blueprint/co...
Author: gnodet
Date: Wed Jan 31 20:10:03 2018
New Revision: 1822826
URL: http://svn.apache.org/viewvc?rev=1822826&view=rev
Log:
Fix indentation / formatting
Modified:
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/BaseManagedServiceFactory.java
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java
aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmUtils.java
aries/trunk/blueprint/blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/Helper.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AggregateConverter.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintQuiesceParticipant.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintRepository.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DependencyGraph.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DestroyCallback.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ExecutorServiceWrapper.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/GenericType.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceListRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/di/CollectionRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/di/MapRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/di/ValueRecipe.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/ext/PropertyPlaceholder.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/ext/impl/ExtNamespaceHandler.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/Collaborator.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/ProxyUtils.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/SingleInterceptorCollaborator.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ParserService.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/HeaderParser.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ServiceUtil.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/ClassUtil.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/GenericsUtil.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/OwbGenericArrayTypeImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/OwbParametrizedTypeImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/OwbWildcardTypeImpl.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/generics/TypeInference.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/RWLock.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/ScheduledExecutorServiceWrapper.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/impl/Discardable.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/impl/DiscardableCallable.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/impl/DiscardableRunnable.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/impl/WrappedFuture.java
aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/threading/impl/WrappedScheduledFuture.java
aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/AbstractBlueprintTest.java
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/BaseManagedServiceFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/BaseManagedServiceFactory.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/BaseManagedServiceFactory.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/BaseManagedServiceFactory.java Wed Jan 31 20:10:03 2018
@@ -143,7 +143,7 @@ public abstract class BaseManagedService
}
ServiceRegistration registration = context.registerService(getExposedClasses(t), t, properties);
services.put(pid, new Pair<T, ServiceRegistration>(t, registration));
- registrations.put(registration, t);
+ registrations.put(registration, t);
postRegister(t, properties, registration);
} catch (Throwable throwable1) {
try {
@@ -210,7 +210,7 @@ public abstract class BaseManagedService
}
}
- static class Pair<U,V> {
+ static class Pair<U, V> {
private U first;
private V second;
public Pair(U first, V second) {
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedProperties.java Wed Jan 31 20:10:03 2018
@@ -63,7 +63,7 @@ public class CmManagedProperties impleme
private final Object lock = new Object();
private final Set<Object> beans = new HashSet<Object>();
- private Dictionary<String,Object> properties;
+ private Dictionary<String, Object> properties;
private boolean initialized;
public ExtendedBlueprintContainer getBlueprintContainer() {
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmManagedServiceFactory.java Wed Jan 31 20:10:03 2018
@@ -58,7 +58,7 @@ public class CmManagedServiceFactory ext
private List<String> interfaces;
private int autoExport;
private int ranking;
- private Map<Object,Object> serviceProperties;
+ private Map<Object, Object> serviceProperties;
private String managedComponentName;
private String componentDestroyMethod;
private List<ServiceListener> listeners;
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java Wed Jan 31 20:10:03 2018
@@ -333,12 +333,12 @@ public class CmNamespaceHandler implemen
}
private String extractSystemPropertiesAttribute(Element element) {
- for (String uri : EXT_URIS) {
- if (element.hasAttributeNS(uri, SYSTEM_PROPERTIES_ATTRIBUTE)) {
- return element.getAttributeNS(uri, SYSTEM_PROPERTIES_ATTRIBUTE);
- }
- }
- return null;
+ for (String uri : EXT_URIS) {
+ if (element.hasAttributeNS(uri, SYSTEM_PROPERTIES_ATTRIBUTE)) {
+ return element.getAttributeNS(uri, SYSTEM_PROPERTIES_ATTRIBUTE);
+ }
+ }
+ return null;
}
private String extractIgnoreMissingLocations(Element element) {
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java Wed Jan 31 20:10:03 2018
@@ -44,7 +44,7 @@ public class CmPropertyPlaceholder exten
private String persistentId;
private String updateStrategy;
private ManagedObjectManager managedObjectManager;
- private Dictionary<String,Object> properties;
+ private Dictionary<String, Object> properties;
private boolean initialized;
public ExtendedBlueprintContainer getBlueprintContainer() {
@@ -140,7 +140,7 @@ public class CmPropertyPlaceholder exten
}
}
- private <T,U> boolean equals(Dictionary<T,U> d1, Dictionary<T,U> d2) {
+ private <T, U> boolean equals(Dictionary<T, U> d1, Dictionary<T, U> d2) {
if (d1 == null || d1.isEmpty()) {
return d2 == null || d2.isEmpty();
} else if (d2 == null || d1.size() != d2.size()) {
Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmUtils.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmUtils.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmUtils.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmUtils.java Wed Jan 31 20:10:03 2018
@@ -35,7 +35,7 @@ import org.osgi.service.cm.Configuration
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.cm.ConfigurationPlugin;
-public class CmUtils {
+public class CmUtils {
private CmUtils() {
}
Modified: aries/trunk/blueprint/blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/Helper.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/Helper.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/Helper.java (original)
+++ aries/trunk/blueprint/blueprint-cm/src/test/java/org/apache/aries/blueprint/compendium/cm/Helper.java Wed Jan 31 20:10:03 2018
@@ -261,7 +261,7 @@ public final class Helper {
* Provides an iterable collection of references, even if the original array is <code>null</code>.
*/
private static Collection<ServiceReference> asCollection(ServiceReference[] references) {
- return references == null ? new ArrayList<ServiceReference>(0) : Arrays.asList(references);
+ return references == null ? new ArrayList<ServiceReference>(0) : Arrays.asList(references);
}
/**
@@ -497,12 +497,12 @@ public final class Helper {
if (value == null) {
return Collections.emptyList().iterator();
} else if (value instanceof Iterator) {
- return (Iterator<Object>)value;
+ return (Iterator<Object>) value;
} else if (value instanceof Iterable) {
- return ((Iterable<Object>)value).iterator();
+ return ((Iterable<Object>) value).iterator();
} else if (value.getClass().isArray()) {
// TODO we should handle primitive array types?
- List<Object> list = Arrays.asList((Object[])value);
+ List<Object> list = Arrays.asList((Object[]) value);
return list.iterator();
} else if (value instanceof NodeList) {
// lets iterate through DOM results after performing XPaths
@@ -530,7 +530,7 @@ public final class Helper {
if (delimiter != null && s.contains(delimiter)) {
// use a scanner if it contains the delimiter
- Scanner scanner = new Scanner((String)value);
+ Scanner scanner = new Scanner((String) value);
if (DEFAULT_DELIMITER.equals(delimiter)) {
// we use the default delimiter which is a comma, then cater for bean expressions with OGNL
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java Wed Jan 31 20:10:03 2018
@@ -269,7 +269,7 @@ public abstract class AbstractServiceRef
@SuppressWarnings("unchecked")
protected void createListeners() {
if (listenersRecipe != null) {
- List<Listener> listeners = (List<Listener>)listenersRecipe.create();
+ List<Listener> listeners = (List<Listener>) listenersRecipe.create();
for (Listener listener : listeners) {
List<Class> classList = new ArrayList<Class>();
Class clz = getInterfaceClass();
@@ -334,20 +334,20 @@ public abstract class AbstractServiceRef
}
public void serviceChanged(ServiceEvent event) {
- int eventType = event.getType();
- ServiceReference ref = event.getServiceReference();
- switch (eventType) {
- case ServiceEvent.REGISTERED:
- serviceAdded(ref, event);
- break;
- case ServiceEvent.MODIFIED:
- serviceModified(ref, event);
- break;
- case ServiceEvent.UNREGISTERING:
- serviceRemoved(ref, event);
- break;
- }
- }
+ int eventType = event.getType();
+ ServiceReference ref = event.getServiceReference();
+ switch (eventType) {
+ case ServiceEvent.REGISTERED:
+ serviceAdded(ref, event);
+ break;
+ case ServiceEvent.MODIFIED:
+ serviceModified(ref, event);
+ break;
+ case ServiceEvent.UNREGISTERING:
+ serviceRemoved(ref, event);
+ break;
+ }
+ }
private void serviceAdded(ServiceReference ref, ServiceEvent event) {
@@ -395,16 +395,16 @@ public abstract class AbstractServiceRef
protected static Class getRuntimeClass(ServiceReferenceMetadata metadata) {
if (metadata instanceof ExtendedServiceReferenceMetadata && ((ExtendedServiceReferenceMetadata) metadata).getRuntimeInterface() != null) {
- return ((ExtendedServiceReferenceMetadata) metadata).getRuntimeInterface();
- }
+ return ((ExtendedServiceReferenceMetadata) metadata).getRuntimeInterface();
+ }
return null;
}
protected BundleContext getBundleContextForServiceLookup() {
if (metadata instanceof ExtendedServiceReferenceMetadata && ((ExtendedServiceReferenceMetadata) metadata).getRuntimeInterface() != null) {
BundleContext context = ((ExtendedServiceReferenceMetadata) metadata).getBundleContext();
- if(context != null) {
- return context;
+ if (context != null) {
+ return context;
}
}
@@ -625,7 +625,7 @@ public abstract class AbstractServiceRef
}
if (interfaceName != null && interfaceName.length() > 0) {
if (metadata instanceof ExtendedReferenceMetadata) {
- ExtendedReferenceMetadata erm = (ExtendedReferenceMetadata)metadata;
+ ExtendedReferenceMetadata erm = (ExtendedReferenceMetadata) metadata;
if (!erm.getExtraInterfaces().isEmpty()) {
StringBuilder sb = new StringBuilder("(&");
sb.append("(" + Constants.OBJECTCLASS + "=" + interfaceName + ")");
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AggregateConverter.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AggregateConverter.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AggregateConverter.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AggregateConverter.java Wed Jan 31 20:10:03 2018
@@ -107,7 +107,7 @@ public class AggregateConverter implemen
if (fromValue == null) {
return true;
} else if (fromValue instanceof UnwrapperedBeanHolder) {
- fromValue = ((UnwrapperedBeanHolder) fromValue).unwrapperedBean;
+ fromValue = ((UnwrapperedBeanHolder) fromValue).unwrapperedBean;
}
if (isAssignable(fromValue, toType)) {
return true;
@@ -147,14 +147,14 @@ public class AggregateConverter implemen
if (fromValue instanceof Convertible) {
return ((Convertible) fromValue).convert(type);
} else if (fromValue instanceof UnwrapperedBeanHolder) {
- UnwrapperedBeanHolder holder = (UnwrapperedBeanHolder) fromValue;
- if (isAssignable(holder.unwrapperedBean, type)) {
+ UnwrapperedBeanHolder holder = (UnwrapperedBeanHolder) fromValue;
+ if (isAssignable(holder.unwrapperedBean, type)) {
return BeanRecipe.wrap(holder, type.getRawClass());
} else {
- fromValue = BeanRecipe.wrap(holder, Object.class);
+ fromValue = BeanRecipe.wrap(holder, Object.class);
}
} else if (isAssignable(fromValue, type)) {
- // If the object is an instance of the type, just return it
+ // If the object is an instance of the type, just return it
return fromValue;
}
@@ -200,17 +200,17 @@ public class AggregateConverter implemen
}
private boolean canConvertWithConverters(Object source, ReifiedType type) {
- return selectMatchingConverter(source,type) != null;
+ return selectMatchingConverter(source, type) != null;
}
private ConversionResult convertWithConverters(Object source, ReifiedType type) throws Exception {
- Converter converter = selectMatchingConverter(source,type);
+ Converter converter = selectMatchingConverter(source, type);
- if (converter == null) return null;
+ if (converter == null) return null;
Object value = converter.convert(source, type);
- return new ConversionResult(converter,value);
+ return new ConversionResult(converter, value);
}
public Object convertToNumber(Number value, Class toType) throws Exception {
@@ -293,7 +293,7 @@ public class AggregateConverter implemen
} else if (Character.class == toType) {
if (value.length() == 6 && value.startsWith("\\u")) {
int code = Integer.parseInt(value.substring(2), 16);
- return (char)code;
+ return (char) code;
} else if (value.length() == 1) {
return value.charAt(0);
} else {
@@ -377,7 +377,7 @@ public class AggregateConverter implemen
return converted ? newDic : obj;
} else {
Dictionary newDic = new Hashtable();
- for (Map.Entry e : ((Map<Object,Object>) obj).entrySet()) {
+ for (Map.Entry e : ((Map<Object, Object>) obj).entrySet()) {
try {
newDic.put(convert(e.getKey(), keyType), convert(e.getValue(), valueType));
} catch (Exception t) {
@@ -406,7 +406,7 @@ public class AggregateConverter implemen
return newMap;
} else {
boolean converted = false;
- for (Map.Entry e : ((Map<Object,Object>) obj).entrySet()) {
+ for (Map.Entry e : ((Map<Object, Object>) obj).entrySet()) {
try {
Object nk = convert(e.getKey(), keyType);
Object nv = convert(e.getValue(), valueType);
@@ -505,7 +505,7 @@ public class AggregateConverter implemen
if (!to.isAssignableFrom(from.getRawClass())) {
return null;
}
- for (ReifiedType superType: getExactDirectSuperTypes(from)) {
+ for (ReifiedType superType : getExactDirectSuperTypes(from)) {
ReifiedType result = getExactSuperType(superType, to);
if (result != null)
return result;
@@ -606,7 +606,7 @@ public class AggregateConverter implemen
}
public Object convert(Object source, Type target) throws Exception {
- return convert( source, new GenericType(target));
+ return convert(source, new GenericType(target));
}
private Class toClass(ReifiedType type) {
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java Wed Jan 31 20:10:03 2018
@@ -315,7 +315,7 @@ public class BeanRecipe extends Abstract
throw wrapAsCompDefEx(e);
}
} else if (factoryObj instanceof UnwrapperedBeanHolder) {
- factoryObj = wrap((UnwrapperedBeanHolder) factoryObj, Object.class);
+ factoryObj = wrap((UnwrapperedBeanHolder) factoryObj, Object.class);
}
return factoryObj;
}
@@ -436,7 +436,7 @@ public class BeanRecipe extends Abstract
}
if (assignable) {
return obj instanceof UnwrapperedBeanHolder
- ? ((UnwrapperedBeanHolder) obj).unwrapperedBean : obj;
+ ? ((UnwrapperedBeanHolder) obj).unwrapperedBean : obj;
}
}
return convert(obj, to);
@@ -534,7 +534,7 @@ public class BeanRecipe extends Abstract
BeanProcessor parentBeanProcessor,
BeanMetadata beanData,
String beanName,
- ChainType when){
+ ChainType when) {
this.parentBeanCreator = parentBeanCreator;
this.parentBeanProcessor = parentBeanProcessor;
this.beanData = beanData;
@@ -545,19 +545,19 @@ public class BeanRecipe extends Abstract
public Object getBean() {
Object previousBean = parentBeanCreator.getBean();
Object processed = null;
- switch(when){
- case Before :
- processed = parentBeanProcessor.beforeInit(previousBean, beanName, parentBeanCreator, beanData);
- break;
+ switch (when) {
+ case Before:
+ processed = parentBeanProcessor.beforeInit(previousBean, beanName, parentBeanCreator, beanData);
+ break;
case After:
- processed = parentBeanProcessor.afterInit(previousBean, beanName, parentBeanCreator, beanData);
- break;
+ processed = parentBeanProcessor.afterInit(previousBean, beanName, parentBeanCreator, beanData);
+ break;
}
return processed;
}
}
- private Object runBeanProcPreInit(Object obj){
+ private Object runBeanProcPreInit(Object obj) {
String beanName = getName();
BeanMetadata beanData = (BeanMetadata) blueprintContainer
.getComponentDefinitionRegistry().getComponentDefinition(beanName);
@@ -576,7 +576,7 @@ public class BeanRecipe extends Abstract
};
BeanProcessor.BeanCreator currentCreator = initialBeanCreator;
- for(BeanProcessor processor : processors){
+ for (BeanProcessor processor : processors) {
obj = processor.beforeInit(obj, getName(), currentCreator, beanData);
currentCreator = new BeanCreatorChain(currentCreator, processor, beanData, beanName, BeanCreatorChain.ChainType.Before);
}
@@ -594,10 +594,10 @@ public class BeanRecipe extends Abstract
}
}
- private Object runBeanProcPostInit(Object obj){
+ private Object runBeanProcPostInit(Object obj) {
String beanName = getName();
BeanMetadata beanData = (BeanMetadata) blueprintContainer
- .getComponentDefinitionRegistry().getComponentDefinition(beanName);
+ .getComponentDefinitionRegistry().getComponentDefinition(beanName);
List<BeanProcessor> processors = blueprintContainer.getProcessors(BeanProcessor.class);
//The start link of the chain, that provides the
@@ -618,7 +618,7 @@ public class BeanRecipe extends Abstract
};
BeanProcessor.BeanCreator currentCreator = initialBeanCreator;
- for(BeanProcessor processor : processors){
+ for (BeanProcessor processor : processors) {
obj = processor.afterInit(obj, getName(), currentCreator, beanData);
currentCreator = new BeanCreatorChain(currentCreator, processor, beanData, beanName, BeanCreatorChain.ChainType.After);
}
@@ -629,9 +629,9 @@ public class BeanRecipe extends Abstract
throws ComponentDefinitionException {
Object intercepted = null;
- if(requiredInterfaces.isEmpty())
- requiredInterfaces.add(original.getClass());
-
+ if (requiredInterfaces.isEmpty())
+ requiredInterfaces.add(original.getClass());
+
ComponentDefinitionRegistry reg = blueprintContainer
.getComponentDefinitionRegistry();
List<Interceptor> interceptors = reg.getInterceptors(interceptorLookupKey);
@@ -643,7 +643,7 @@ public class BeanRecipe extends Abstract
b = blueprintContainer.getBundleContext().getBundle();
}
intercepted = blueprintContainer.getProxyManager().createInterceptingProxy(b,
- requiredInterfaces, original, CollaboratorFactory.create(interceptorLookupKey, interceptors));
+ requiredInterfaces, original, CollaboratorFactory.create(interceptorLookupKey, interceptors));
} catch (org.apache.aries.proxy.UnableToProxyException e) {
Bundle b = blueprintContainer.getBundleContext().getBundle();
throw new ComponentDefinitionException("Unable to create proxy for bean " + name + " in bundle " + b.getSymbolicName() + "/" + b.getVersion(), e);
@@ -714,11 +714,11 @@ public class BeanRecipe extends Abstract
}
static Object wrap(UnwrapperedBeanHolder holder, Class<?> requiredView) {
- if(requiredView == Object.class) {
- //We don't know what we need so we have to do everything
+ if (requiredView == Object.class) {
+ //We don't know what we need so we have to do everything
return holder.recipe.addInterceptors(holder.unwrapperedBean, new ArrayList<Class<?>>(1));
} else {
- return holder.recipe.addInterceptors(holder.unwrapperedBean, ProxyUtils.asList(requiredView));
+ return holder.recipe.addInterceptors(holder.unwrapperedBean, ProxyUtils.asList(requiredView));
}
}
@@ -730,8 +730,8 @@ public class BeanRecipe extends Abstract
return;
}
- obj = ((UnwrapperedBeanHolder)obj).unwrapperedBean;
+ obj = ((UnwrapperedBeanHolder) obj).unwrapperedBean;
for (BeanProcessor processor : blueprintContainer.getProcessors(BeanProcessor.class)) {
processor.beforeDestroy(obj, getName());
}
@@ -744,10 +744,10 @@ public class BeanRecipe extends Abstract
// This exception occurs if the destroy method does not exist, so we just output the exception message.
LOGGER.error(e.getMessage());
} catch (InvocationTargetException ite) {
- Throwable t = ite.getTargetException();
- BundleContext ctx = blueprintContainer.getBundleContext();
- Bundle b = ctx.getBundle();
- LOGGER.error("The blueprint bean {} in bundle {}/{} incorrectly threw an exception from its destroy method.", getName(), b.getSymbolicName(), b.getVersion(), t);
+ Throwable t = ite.getTargetException();
+ BundleContext ctx = blueprintContainer.getBundleContext();
+ Bundle b = ctx.getBundle();
+ LOGGER.error("The blueprint bean {} in bundle {}/{} incorrectly threw an exception from its destroy method.", getName(), b.getSymbolicName(), b.getVersion(), t);
} catch (Exception e) {
BundleContext ctx = blueprintContainer.getBundleContext();
Bundle b = ctx.getBundle();
@@ -760,7 +760,7 @@ public class BeanRecipe extends Abstract
public void setProperties(Object instance) throws ComponentDefinitionException {
// clone the properties so they can be used again
- Map<String,Object> propertyValues = new LinkedHashMap<String,Object>(properties);
+ Map<String, Object> propertyValues = new LinkedHashMap<String, Object>(properties);
setProperties(propertyValues, instance, instance.getClass());
}
@@ -917,20 +917,20 @@ public class BeanRecipe extends Abstract
} else if (arg != null) {
if (convert) {
- if(canConvert(arg, entry.type)) {
+ if (canConvert(arg, entry.type)) {
try {
- val = convert(arg, entry.type);
- } catch (Exception e) {
- throw new ComponentDefinitionException(e);
- }
- } else {
+ val = convert(arg, entry.type);
+ } catch (Exception e) {
+ throw new ComponentDefinitionException(e);
+ }
+ } else {
continue;
}
} else {
- UnwrapperedBeanHolder holder = null;
- if(arg instanceof UnwrapperedBeanHolder) {
- holder = (UnwrapperedBeanHolder)arg;
- arg = holder.unwrapperedBean;
+ UnwrapperedBeanHolder holder = null;
+ if (arg instanceof UnwrapperedBeanHolder) {
+ holder = (UnwrapperedBeanHolder) arg;
+ arg = holder.unwrapperedBean;
}
if (!AggregateConverter.isAssignable(arg, entry.type)) {
continue;
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java Wed Jan 31 20:10:03 2018
@@ -212,7 +212,7 @@ public class BlueprintContainerImpl
private void readDirectives() {
Dictionary headers = bundle.getHeaders();
- String symbolicName = (String)headers.get(Constants.BUNDLE_SYMBOLICNAME);
+ String symbolicName = (String) headers.get(Constants.BUNDLE_SYMBOLICNAME);
List<PathElement> paths = HeaderParser.parseHeader(symbolicName);
String timeoutDirective = paths.get(0).getDirective(BlueprintConstants.TIMEOUT_DIRECTIVE);
@@ -411,17 +411,17 @@ public class BlueprintContainerImpl
case Create:
cancelFutureIfPresent();
instantiateEagerComponents();
- //Register the services after the eager components are ready, as per 121.6
- registerServices();
+ //Register the services after the eager components are ready, as per 121.6
+ registerServices();
// Register the BlueprintContainer in the OSGi registry
int bs = bundle.getState();
if (registration == null && (bs == Bundle.ACTIVE || bs == Bundle.STARTING)) {
Properties props = new Properties();
props.put(BlueprintConstants.CONTAINER_SYMBOLIC_NAME_PROPERTY,
- bundle.getSymbolicName());
+ bundle.getSymbolicName());
props.put(BlueprintConstants.CONTAINER_VERSION_PROPERTY,
- JavaUtils.getBundleVersion(bundle));
- registration = registerService(new String [] { BlueprintContainer.class.getName() }, this, props);
+ JavaUtils.getBundleVersion(bundle));
+ registration = registerService(new String[]{BlueprintContainer.class.getName()}, this, props);
}
eventDispatcher.blueprintEvent(new BlueprintEvent(BlueprintEvent.CREATED, getBundle(), getExtenderBundle()));
state = State.Created;
@@ -904,16 +904,15 @@ public class BlueprintContainerImpl
eventDispatcher.blueprintEvent(new BlueprintEvent(BlueprintEvent.DESTROYED, getBundle(), getExtenderBundle()));
LOGGER.debug("Blueprint container {} destroyed", getBundle().getSymbolicName(), getBundle().getVersion());
}
-
- public static void safeUnregisterService(ServiceRegistration reg)
- {
- if(reg != null) {
- try {
- reg.unregister();
- } catch (IllegalStateException e) {
- //This can be safely ignored
+
+ public static void safeUnregisterService(ServiceRegistration reg) {
+ if (reg != null) {
+ try {
+ reg.unregister();
+ } catch (IllegalStateException e) {
+ //This can be safely ignored
+ }
}
- }
}
protected void quiesce() {
@@ -929,11 +928,10 @@ public class BlueprintContainerImpl
LOGGER.debug("Blueprint container {} quiesced", getBundle().getSymbolicName(), getBundle().getVersion());
}
- private void cancelFutureIfPresent()
- {
- if (timeoutFuture != null) {
- timeoutFuture.cancel(false);
- }
+ private void cancelFutureIfPresent() {
+ if (timeoutFuture != null) {
+ timeoutFuture.cancel(false);
+ }
}
public void namespaceHandlerRegistered(URI uri) {
@@ -963,17 +961,16 @@ public class BlueprintContainerImpl
}
}
- private void tidyupComponents()
- {
- unregisterServices();
- destroyComponents();
- untrackServiceReferences();
+ private void tidyupComponents() {
+ unregisterServices();
+ destroyComponents();
+ untrackServiceReferences();
}
- public void injectBeanInstance(BeanMetadata bmd, Object o)
- throws IllegalArgumentException, ComponentDefinitionException {
- ExecutionContext origContext
- = ExecutionContext.Holder.setContext((ExecutionContext)getRepository());
+ public void injectBeanInstance(BeanMetadata bmd, Object o)
+ throws IllegalArgumentException, ComponentDefinitionException {
+ ExecutionContext origContext
+ = ExecutionContext.Holder.setContext((ExecutionContext) getRepository());
try {
ComponentMetadata cmd = componentDefinitionRegistry.getComponentDefinition(bmd.getId());
if (cmd == null || cmd != bmd) {
@@ -981,7 +978,7 @@ public class BlueprintContainerImpl
}
Recipe r = this.getRepository().getRecipe(bmd.getId());
if (r instanceof BeanRecipe) {
- BeanRecipe br = (BeanRecipe)r;
+ BeanRecipe br = (BeanRecipe) r;
if (!br.getType().isInstance(o)) {
throw new IllegalArgumentException("Instance class " + o.getClass().getName()
+ " is not an instance of " + br.getClass());
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java Wed Jan 31 20:10:03 2018
@@ -74,11 +74,10 @@ class BlueprintEventDispatcher implement
assert bundleContext != null;
executor = new ScheduledExecutorServiceWrapper(bundleContext, "Blueprint Event Dispatcher", new ScheduledExecutorServiceFactory() {
-
- public ScheduledExecutorService create(String name)
- {
- return Executors.newScheduledThreadPool(1, new BlueprintThreadFactory(name));
- }
+
+ public ScheduledExecutorService create(String name) {
+ return Executors.newScheduledThreadPool(1, new BlueprintThreadFactory(name));
+ }
});
EventAdminListener listener = null;
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java Wed Jan 31 20:10:03 2018
@@ -94,10 +94,9 @@ public class BlueprintExtender implement
handlers = new NamespaceHandlerRegistryImpl(trackingContext);
executors = new ScheduledExecutorServiceWrapper(ctx, "Blueprint Extender", new ScheduledExecutorServiceFactory() {
- public ScheduledExecutorService create(String name)
- {
- return Executors.newScheduledThreadPool(3, new BlueprintThreadFactory(name));
- }
+ public ScheduledExecutorService create(String name) {
+ return Executors.newScheduledThreadPool(3, new BlueprintThreadFactory(name));
+ }
});
eventDispatcher = new BlueprintEventDispatcher(ctx);
@@ -108,40 +107,42 @@ public class BlueprintExtender implement
// handled.
context.addBundleListener(this);
int mask = Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING | Bundle.ACTIVE;
- bt = useSystemContext ? new BundleTracker(trackingContext, mask, this) : new RecursiveBundleTracker(ctx, mask, this);
+ bt = useSystemContext ? new BundleTracker(trackingContext, mask, this) : new RecursiveBundleTracker(ctx, mask, this);
proxyManager = new SingleServiceTracker<ProxyManager>(ctx, ProxyManager.class, new SingleServiceListener() {
- public void serviceFound() {
- LOGGER.debug("Found ProxyManager service, starting to process blueprint bundles");
- if (bt instanceof BundleTracker) {
- ((BundleTracker) bt).open();
- } else if (bt instanceof RecursiveBundleTracker) {
- ((RecursiveBundleTracker) bt).open();
- }
- }
- public void serviceLost() {
- while (!containers.isEmpty()) {
- for (Bundle bundle : getBundlesToDestroy()) {
- destroyContainer(bundle);
- }
+ public void serviceFound() {
+ LOGGER.debug("Found ProxyManager service, starting to process blueprint bundles");
+ if (bt instanceof BundleTracker) {
+ ((BundleTracker) bt).open();
+ } else if (bt instanceof RecursiveBundleTracker) {
+ ((RecursiveBundleTracker) bt).open();
+ }
+ }
+
+ public void serviceLost() {
+ while (!containers.isEmpty()) {
+ for (Bundle bundle : getBundlesToDestroy()) {
+ destroyContainer(bundle);
+ }
+ }
+ if (bt instanceof BundleTracker) {
+ ((BundleTracker) bt).close();
+ } else if (bt instanceof RecursiveBundleTracker) {
+ ((RecursiveBundleTracker) bt).close();
+ }
+ }
+
+ public void serviceReplaced() {
}
- if (bt instanceof BundleTracker) {
- ((BundleTracker) bt).close();
- } else if (bt instanceof RecursiveBundleTracker) {
- ((RecursiveBundleTracker) bt).close();
- }
- }
- public void serviceReplaced() {
- }
});
proxyManager.open();
// Determine if the ParserService should ignore unknown namespace handlers
boolean ignoreUnknownNamespaceHandlers = Boolean.parseBoolean(ctx.getProperty(BlueprintConstants.IGNORE_UNKNOWN_NAMESPACE_HANDLERS_PROPERTY));
// Create and publish a ParserService
- parserServiceReg = ctx.registerService(ParserService.class.getName(),
- new ParserServiceImpl (handlers, ignoreUnknownNamespaceHandlers),
- new Hashtable<String, Object>());
+ parserServiceReg = ctx.registerService(ParserService.class.getName(),
+ new ParserServiceImpl(handlers, ignoreUnknownNamespaceHandlers),
+ new Hashtable<String, Object>());
// Create and publish a BlueprintContainerService
blueprintServiceReg = ctx.registerService(
@@ -149,16 +150,14 @@ public class BlueprintExtender implement
new BlueprintContainerServiceImpl(),
new Hashtable<String, Object>());
- try{
+ try {
ctx.getBundle().loadClass(QUIESCE_PARTICIPANT_CLASS);
//Class was loaded, register
- quiesceParticipantReg = ctx.registerService(QUIESCE_PARTICIPANT_CLASS,
- new BlueprintQuiesceParticipant(ctx, this),
- new Hashtable<String, Object>());
- }
- catch (ClassNotFoundException e)
- {
+ quiesceParticipantReg = ctx.registerService(QUIESCE_PARTICIPANT_CLASS,
+ new BlueprintQuiesceParticipant(ctx, this),
+ new Hashtable<String, Object>());
+ } catch (ClassNotFoundException e) {
LOGGER.info("No quiesce support is available, so blueprint components will not participate in quiesce operations");
}
@@ -182,9 +181,9 @@ public class BlueprintExtender implement
}
if (bt instanceof BundleTracker) {
- ((BundleTracker) bt).close();
+ ((BundleTracker) bt).close();
} else if (bt instanceof RecursiveBundleTracker) {
- ((RecursiveBundleTracker) bt).close();
+ ((RecursiveBundleTracker) bt).close();
}
proxyManager.close();
@@ -529,7 +528,7 @@ public class BlueprintExtender implement
interface ExecutorServiceFinder {
- public ExecutorService find( Bundle bundle );
+ public ExecutorService find(Bundle bundle);
}
@@ -584,16 +583,15 @@ public class BlueprintExtender implement
while (e != null && e.hasMoreElements()) {
URL u = (URL) e.nextElement();
URL override = getOverrideURL(bundle, u, path);
- if(override == null) {
+ if (override == null) {
pathList.add(u);
} else {
pathList.add(override);
}
}
}
-
- protected BlueprintContainerImpl getBlueprintContainerImpl(Bundle bundle)
- {
+
+ protected BlueprintContainerImpl getBlueprintContainerImpl(Bundle bundle) {
return containers.get(bundle);
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintQuiesceParticipant.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintQuiesceParticipant.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintQuiesceParticipant.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintQuiesceParticipant.java Wed Jan 31 20:10:03 2018
@@ -37,127 +37,118 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-public class BlueprintQuiesceParticipant implements QuiesceParticipant
-{
- private final BundleContext ctx;
- private final BlueprintExtender extender;
-
- public BlueprintQuiesceParticipant(BundleContext context, BlueprintExtender extender)
- {
- this.ctx = context;
- this.extender = extender;
- }
-
- /**
- * A Threadpool for running quiesce operations
- */
- private final ExecutorService executor = new ThreadPoolExecutor(0, 10, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory()
- {
- public Thread newThread(Runnable r)
- {
- Thread t = new Thread(r, "Blueprint-Container-ThreadPool");
- t.setDaemon(true);
- return t;
- }
+public class BlueprintQuiesceParticipant implements QuiesceParticipant {
+ private final BundleContext ctx;
+ private final BlueprintExtender extender;
+
+ public BlueprintQuiesceParticipant(BundleContext context, BlueprintExtender extender) {
+ this.ctx = context;
+ this.extender = extender;
+ }
+
+ /**
+ * A Threadpool for running quiesce operations
+ */
+ private final ExecutorService executor = new ThreadPoolExecutor(0, 10, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory() {
+ public Thread newThread(Runnable r) {
+ Thread t = new Thread(r, "Blueprint-Container-ThreadPool");
+ t.setDaemon(true);
+ return t;
+ }
});
-
- public void quiesce(QuiesceCallback callback, List<Bundle> bundlesToQuiesce)
- {
- boolean shutdownMe = false;
- for(Bundle b : bundlesToQuiesce)
- {
- try
- {
- executor.execute(new QuiesceBundle(callback, b, extender));
- }
- catch (RejectedExecutionException re) {
- }
-
- //If we are quiescing, then we need to quiesce this threadpool!
- shutdownMe |= b.equals(ctx.getBundle());
- }
-
- if (shutdownMe) executor.shutdown();
- }
-
- /**
- * A runnable Quiesce operation for a single bundle
- */
- private static final class QuiesceBundle implements Runnable
- {
- /** The bundle being quiesced */
- private final Bundle bundleToQuiesce;
- private final QuiesceCallback callback;
- private final BlueprintExtender extender;
-
- public QuiesceBundle(QuiesceCallback callback, Bundle bundleToQuiesce,
- BlueprintExtender extender)
- {
- super();
- this.callback = callback;
- this.bundleToQuiesce = bundleToQuiesce;
- this.extender = extender;
- }
-
- public void run()
- {
- BlueprintContainerImpl container = extender.getBlueprintContainerImpl(bundleToQuiesce);
-
- // have we got an actual blueprint bundle
- if (container != null) {
- BlueprintRepository repository = container.getRepository();
- Set<String> names = repository.getNames();
- container.quiesce();
-
- QuiesceDelegatingCallback qdcbk = new QuiesceDelegatingCallback(callback, bundleToQuiesce);
- for (String name: names)
- {
- Recipe recipe = repository.getRecipe(name);
- if (recipe instanceof ServiceRecipe)
- {
- qdcbk.callCountDown.incrementAndGet();
- ((ServiceRecipe)recipe).quiesce(qdcbk);
- }
- }
- //Either there were no services and we win, or there were services but they
- //have all finished and we win, or they still have tidy up to do, but we
- //end up at 0 eventually
- qdcbk.callback();
- } else {
- // for non-Blueprint bundles just call return completed
-
- callback.bundleQuiesced(bundleToQuiesce);
- }
- }
- }
-
+
+ public void quiesce(QuiesceCallback callback, List<Bundle> bundlesToQuiesce) {
+ boolean shutdownMe = false;
+ for (Bundle b : bundlesToQuiesce) {
+ try {
+ executor.execute(new QuiesceBundle(callback, b, extender));
+ } catch (RejectedExecutionException re) {
+ }
+
+ //If we are quiescing, then we need to quiesce this threadpool!
+ shutdownMe |= b.equals(ctx.getBundle());
+ }
+
+ if (shutdownMe) executor.shutdown();
+ }
+
+ /**
+ * A runnable Quiesce operation for a single bundle
+ */
+ private static final class QuiesceBundle implements Runnable {
+ /**
+ * The bundle being quiesced
+ */
+ private final Bundle bundleToQuiesce;
+ private final QuiesceCallback callback;
+ private final BlueprintExtender extender;
+
+ public QuiesceBundle(QuiesceCallback callback, Bundle bundleToQuiesce,
+ BlueprintExtender extender) {
+ super();
+ this.callback = callback;
+ this.bundleToQuiesce = bundleToQuiesce;
+ this.extender = extender;
+ }
+
+ public void run() {
+ BlueprintContainerImpl container = extender.getBlueprintContainerImpl(bundleToQuiesce);
+
+ // have we got an actual blueprint bundle
+ if (container != null) {
+ BlueprintRepository repository = container.getRepository();
+ Set<String> names = repository.getNames();
+ container.quiesce();
+
+ QuiesceDelegatingCallback qdcbk = new QuiesceDelegatingCallback(callback, bundleToQuiesce);
+ for (String name : names) {
+ Recipe recipe = repository.getRecipe(name);
+ if (recipe instanceof ServiceRecipe) {
+ qdcbk.callCountDown.incrementAndGet();
+ ((ServiceRecipe) recipe).quiesce(qdcbk);
+ }
+ }
+ //Either there were no services and we win, or there were services but they
+ //have all finished and we win, or they still have tidy up to do, but we
+ //end up at 0 eventually
+ qdcbk.callback();
+ } else {
+ // for non-Blueprint bundles just call return completed
+
+ callback.bundleQuiesced(bundleToQuiesce);
+ }
+ }
+ }
+
/**
- * A wrapper to protect our internals from the Quiesce API so that we can make it
- * an optional dependency
- */
- private static final class QuiesceDelegatingCallback implements DestroyCallback
- {
-
- /** The callback to delegate to */
- private final QuiesceCallback callback;
-
- /** The single bundle being quiesced by this DestroyCallback */
- private final Bundle toQuiesce;
- /** A countdown that starts at one so it can't finish before we do! */
- private final AtomicInteger callCountDown = new AtomicInteger(1);
-
- public QuiesceDelegatingCallback(QuiesceCallback cbk, Bundle b)
- {
- callback = cbk;
- toQuiesce = b;
- }
-
- public void callback()
- {
- if (callCountDown.decrementAndGet() == 0)
- {
- callback.bundleQuiesced(toQuiesce);
- }
- }
- }
+ * A wrapper to protect our internals from the Quiesce API so that we can make it
+ * an optional dependency
+ */
+ private static final class QuiesceDelegatingCallback implements DestroyCallback {
+
+ /**
+ * The callback to delegate to
+ */
+ private final QuiesceCallback callback;
+
+ /**
+ * The single bundle being quiesced by this DestroyCallback
+ */
+ private final Bundle toQuiesce;
+ /**
+ * A countdown that starts at one so it can't finish before we do!
+ */
+ private final AtomicInteger callCountDown = new AtomicInteger(1);
+
+ public QuiesceDelegatingCallback(QuiesceCallback cbk, Bundle b) {
+ callback = cbk;
+ toQuiesce = b;
+ }
+
+ public void callback() {
+ if (callCountDown.decrementAndGet() == 0) {
+ callback.bundleQuiesced(toQuiesce);
+ }
+ }
+ }
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintRepository.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintRepository.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintRepository.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintRepository.java Wed Jan 31 20:10:03 2018
@@ -80,7 +80,7 @@ public class BlueprintRepository impleme
/**
* Contains partial objects.
*/
- private final ThreadLocal<Map<String, Object>> partialObjects = new ThreadLocal<Map<String,Object>>();
+ private final ThreadLocal<Map<String, Object>> partialObjects = new ThreadLocal<Map<String, Object>>();
/**
* Before each recipe is executed it is pushed on the stack. The
@@ -159,11 +159,11 @@ public class BlueprintRepository impleme
public Object create(String name, Collection<Class<?>> proxyInterfaces) throws ComponentDefinitionException {
ExecutionContext oldContext = ExecutionContext.Holder.setContext(this);
try {
- Object instance = createInstance(name);
- if(instance instanceof UnwrapperedBeanHolder)
+ Object instance = createInstance(name);
+ if (instance instanceof UnwrapperedBeanHolder)
instance = BeanRecipe.wrap((UnwrapperedBeanHolder) instance, proxyInterfaces);
return convert(name, instance);
- } finally {
+ } finally {
ExecutionContext.Holder.setContext(oldContext);
}
}
@@ -174,8 +174,8 @@ public class BlueprintRepository impleme
Map<String, Object> instances = createInstances(names);
for (String name : instances.keySet()) {
Object obj = instances.get(name);
- if(obj instanceof UnwrapperedBeanHolder)
- obj = BeanRecipe.wrap((UnwrapperedBeanHolder) obj, proxyInterfaces);
+ if (obj instanceof UnwrapperedBeanHolder)
+ obj = BeanRecipe.wrap((UnwrapperedBeanHolder) obj, proxyInterfaces);
instances.put(name, convert(name, obj));
}
return instances;
@@ -335,8 +335,8 @@ public class BlueprintRepository impleme
private Object createInstance(String name) {
Object instance = getInstance(name);
if (instance == null) {
- Map <String, Object> instances = createInstances(Arrays.asList(name));
- instance = instances.get(name);
+ Map<String, Object> instances = createInstances(Arrays.asList(name));
+ instance = instances.get(name);
if (instance == null) {
throw new NoSuchComponentException(name);
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DependencyGraph.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DependencyGraph.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DependencyGraph.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DependencyGraph.java Wed Jan 31 20:10:03 2018
@@ -55,7 +55,7 @@ public class DependencyGraph {
if (!recipe.getName().equals(name)) {
throw new RuntimeException("Recipe '" + name + "' returned from the repository has name '" + name + "'");
}
- createNode(name, recipe, nodes);
+ createNode(name, recipe, nodes);
}
}
@@ -132,7 +132,7 @@ public class DependencyGraph {
if (nodes.containsKey(name)) {
Node node = nodes.get(name);
if (node.recipe != recipe) {
- throw new RuntimeException("The name '" + name +"' is assigned to multiple recipies");
+ throw new RuntimeException("The name '" + name + "' is assigned to multiple recipies");
}
return node;
}
@@ -148,7 +148,7 @@ public class DependencyGraph {
while (!constructorRecipes.isEmpty()) {
Recipe nestedRecipe = constructorRecipes.removeFirst();
if (nestedRecipe instanceof RefRecipe) {
- nestedRecipe = nestedRecipe.getDependencies().get(0);
+ nestedRecipe = nestedRecipe.getDependencies().get(0);
String nestedName = nestedRecipe.getName();
Node nestedNode = createNode(nestedName, nestedRecipe, nodes);
node.referenceCount++;
@@ -173,7 +173,7 @@ public class DependencyGraph {
if (references.size() > 0) {
buf.append(" <- ");
Iterator<Node> iter = references.iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
buf.append(iter.next().name);
if (iter.hasNext()) {
buf.append(", ");
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DestroyCallback.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DestroyCallback.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DestroyCallback.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/DestroyCallback.java Wed Jan 31 20:10:03 2018
@@ -22,5 +22,5 @@ package org.apache.aries.blueprint.conta
* A callback to indicate that a destroy operation has completed
*/
public interface DestroyCallback {
- public void callback();
+ public void callback();
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ExecutorServiceWrapper.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ExecutorServiceWrapper.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ExecutorServiceWrapper.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ExecutorServiceWrapper.java Wed Jan 31 20:10:03 2018
@@ -86,7 +86,7 @@ public class ExecutorServiceWrapper exte
}
protected void triggerExecution() {
- if( triggered.compareAndSet(false, true) ) {
+ if (triggered.compareAndSet(false, true)) {
delegate.execute(this);
}
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/GenericType.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/GenericType.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/GenericType.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/GenericType.java Wed Jan 31 20:10:03 2018
@@ -41,7 +41,7 @@ import org.osgi.service.blueprint.contai
*/
public class GenericType extends ReifiedType {
- private static final GenericType[] EMPTY = new GenericType[0];
+ private static final GenericType[] EMPTY = new GenericType[0];
private static final Map<String, Class> primitiveClasses = new HashMap<String, Class>();
@@ -65,9 +65,9 @@ public class GenericType extends Reified
private GenericType[] parameters;
private BoundType boundType;
- public GenericType(Type type) {
- this(getConcreteClass(type), boundType(type), parametersOf(type));
- }
+ public GenericType(Type type) {
+ this(getConcreteClass(type), boundType(type), parametersOf(type));
+ }
public GenericType(Class clazz, GenericType... parameters) {
this(clazz, BoundType.Exact, parameters);
@@ -119,17 +119,17 @@ public class GenericType extends Reified
return new GenericType(((ClassLoader) loader).loadClass(type));
} else if (loader instanceof Bundle) {
try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<GenericType>() {
- public GenericType run() throws ClassNotFoundException {
- return new GenericType(((Bundle) loader).loadClass(type));
- }
- });
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<GenericType>() {
+ public GenericType run() throws ClassNotFoundException {
+ return new GenericType(((Bundle) loader).loadClass(type));
+ }
+ });
} catch (PrivilegedActionException pae) {
- Exception e = pae.getException();
- if (e instanceof ClassNotFoundException)
- throw (ClassNotFoundException) e;
- else
- throw (RuntimeException) e;
+ Exception e = pae.getException();
+ if (e instanceof ClassNotFoundException)
+ throw (ClassNotFoundException) e;
+ else
+ throw (RuntimeException) e;
}
} else if (loader instanceof ExecutionContext) {
return new GenericType(((ExecutionContext) loader).loadClass(type));
@@ -178,7 +178,7 @@ public class GenericType extends Reified
}
sb.append(parameters[i].toString());
}
- sb.append(">");
+ sb.append(">");
}
return sb.toString();
}
@@ -239,30 +239,30 @@ public class GenericType extends Reified
}
static GenericType[] parametersOf(Type type) {
- if (type instanceof Class) {
- Class clazz = (Class) type;
- if (clazz.isArray()) {
+ if (type instanceof Class) {
+ Class clazz = (Class) type;
+ if (clazz.isArray()) {
GenericType t = new GenericType(clazz.getComponentType());
if (t.size() > 0) {
return new GenericType[] { t };
} else {
return EMPTY;
}
- } else {
- return EMPTY;
- }
- }
+ } else {
+ return EMPTY;
+ }
+ }
if (type instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) type;
- Type [] parameters = pt.getActualTypeArguments();
+ Type[] parameters = pt.getActualTypeArguments();
GenericType[] gts = new GenericType[parameters.length];
- for ( int i =0; i<gts.length; i++) {
+ for (int i = 0; i < gts.length; i++) {
gts[i] = new GenericType(parameters[i]);
}
return gts;
}
if (type instanceof GenericArrayType) {
- return new GenericType[] { new GenericType(((GenericArrayType) type).getGenericComponentType()) };
+ return new GenericType[]{new GenericType(((GenericArrayType) type).getGenericComponentType())};
}
if (type instanceof WildcardType) {
return EMPTY;
@@ -271,38 +271,38 @@ public class GenericType extends Reified
return EMPTY;
}
throw new IllegalStateException();
- }
+ }
- static Class<?> getConcreteClass(Type type) {
- Type ntype = collapse(type);
- if ( ntype instanceof Class )
- return (Class<?>) ntype;
-
- if ( ntype instanceof ParameterizedType )
- return getConcreteClass(collapse(((ParameterizedType)ntype).getRawType()));
-
- throw new RuntimeException("Unknown type " + type );
- }
-
- static Type collapse(Type target) {
- if (target instanceof Class || target instanceof ParameterizedType ) {
- return target;
- } else if (target instanceof TypeVariable) {
- return collapse(((TypeVariable<?>) target).getBounds()[0]);
- } else if (target instanceof GenericArrayType) {
- Type t = collapse(((GenericArrayType) target)
- .getGenericComponentType());
- while ( t instanceof ParameterizedType )
- t = collapse(((ParameterizedType)t).getRawType());
- return Array.newInstance((Class<?>)t, 0).getClass();
- } else if (target instanceof WildcardType) {
- WildcardType wct = (WildcardType) target;
- if (wct.getLowerBounds().length == 0)
- return collapse(wct.getUpperBounds()[0]);
- else
- return collapse(wct.getLowerBounds()[0]);
- }
- throw new RuntimeException("Huh? " + target);
- }
+ static Class<?> getConcreteClass(Type type) {
+ Type ntype = collapse(type);
+ if (ntype instanceof Class)
+ return (Class<?>) ntype;
+
+ if (ntype instanceof ParameterizedType)
+ return getConcreteClass(collapse(((ParameterizedType) ntype).getRawType()));
+
+ throw new RuntimeException("Unknown type " + type);
+ }
+
+ static Type collapse(Type target) {
+ if (target instanceof Class || target instanceof ParameterizedType) {
+ return target;
+ } else if (target instanceof TypeVariable) {
+ return collapse(((TypeVariable<?>) target).getBounds()[0]);
+ } else if (target instanceof GenericArrayType) {
+ Type t = collapse(((GenericArrayType) target)
+ .getGenericComponentType());
+ while (t instanceof ParameterizedType)
+ t = collapse(((ParameterizedType) t).getRawType());
+ return Array.newInstance((Class<?>) t, 0).getClass();
+ } else if (target instanceof WildcardType) {
+ WildcardType wct = (WildcardType) target;
+ if (wct.getLowerBounds().length == 0)
+ return collapse(wct.getUpperBounds()[0]);
+ else
+ return collapse(wct.getLowerBounds()[0]);
+ }
+ throw new RuntimeException("Huh? " + target);
+ }
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java Wed Jan 31 20:10:03 2018
@@ -34,61 +34,61 @@ import org.xml.sax.SAXException;
public class ParserServiceImpl implements ParserService {
- final NamespaceHandlerRegistry _namespaceHandlerRegistry;
+ final NamespaceHandlerRegistry _namespaceHandlerRegistry;
final boolean _ignoreUnknownNamespaceHandlers;
- public ParserServiceImpl (NamespaceHandlerRegistry nhr, boolean ignoreUnknownNamespaceHandlers) {
- _namespaceHandlerRegistry = nhr;
- _ignoreUnknownNamespaceHandlers = ignoreUnknownNamespaceHandlers;
- }
-
- public ComponentDefinitionRegistry parse(URL url, Bundle clientBundle) throws Exception {
- return parse (url, clientBundle, false);
- }
-
- public ComponentDefinitionRegistry parse(URL url, Bundle clientBundle, boolean validate)
- throws Exception {
- List<URL> urls = new ArrayList<URL>();
- urls.add(url);
- return parse (urls, clientBundle, validate);
- }
-
- public ComponentDefinitionRegistry parse(List<URL> urls, Bundle clientBundle) throws Exception {
- return parse(urls, clientBundle, false);
- }
-
- public ComponentDefinitionRegistry parse(List<URL> urls, Bundle clientBundle, boolean validate) throws Exception {
- Parser parser = new Parser(null, _ignoreUnknownNamespaceHandlers);
- parser.parse(urls);
- return validateAndPopulate (parser, clientBundle, validate);
- }
-
- public ComponentDefinitionRegistry parse(InputStream is, Bundle clientBundle) throws Exception {
- return parse (is, clientBundle, false);
- }
-
- public ComponentDefinitionRegistry parse(InputStream is, Bundle clientBundle, boolean validate) throws Exception {
- Parser parser = new Parser(null, _ignoreUnknownNamespaceHandlers);
- parser.parse(is);
- return validateAndPopulate (parser, clientBundle, validate);
- }
-
- private ComponentDefinitionRegistry validateAndPopulate (Parser parser, Bundle clientBundle, boolean validate)
- throws IOException, SAXException {
- Set<URI> nsuris = parser.getNamespaces();
- ComponentDefinitionRegistry cdr;
- NamespaceHandlerSet nshandlers = _namespaceHandlerRegistry.getNamespaceHandlers(nsuris, clientBundle);
- try {
- if (validate) {
- parser.validate( nshandlers.getSchema());
+ public ParserServiceImpl(NamespaceHandlerRegistry nhr, boolean ignoreUnknownNamespaceHandlers) {
+ _namespaceHandlerRegistry = nhr;
+ _ignoreUnknownNamespaceHandlers = ignoreUnknownNamespaceHandlers;
+ }
+
+ public ComponentDefinitionRegistry parse(URL url, Bundle clientBundle) throws Exception {
+ return parse(url, clientBundle, false);
+ }
+
+ public ComponentDefinitionRegistry parse(URL url, Bundle clientBundle, boolean validate)
+ throws Exception {
+ List<URL> urls = new ArrayList<URL>();
+ urls.add(url);
+ return parse(urls, clientBundle, validate);
+ }
+
+ public ComponentDefinitionRegistry parse(List<URL> urls, Bundle clientBundle) throws Exception {
+ return parse(urls, clientBundle, false);
+ }
+
+ public ComponentDefinitionRegistry parse(List<URL> urls, Bundle clientBundle, boolean validate) throws Exception {
+ Parser parser = new Parser(null, _ignoreUnknownNamespaceHandlers);
+ parser.parse(urls);
+ return validateAndPopulate(parser, clientBundle, validate);
+ }
+
+ public ComponentDefinitionRegistry parse(InputStream is, Bundle clientBundle) throws Exception {
+ return parse(is, clientBundle, false);
+ }
+
+ public ComponentDefinitionRegistry parse(InputStream is, Bundle clientBundle, boolean validate) throws Exception {
+ Parser parser = new Parser(null, _ignoreUnknownNamespaceHandlers);
+ parser.parse(is);
+ return validateAndPopulate(parser, clientBundle, validate);
+ }
+
+ private ComponentDefinitionRegistry validateAndPopulate(Parser parser, Bundle clientBundle, boolean validate)
+ throws IOException, SAXException {
+ Set<URI> nsuris = parser.getNamespaces();
+ ComponentDefinitionRegistry cdr;
+ NamespaceHandlerSet nshandlers = _namespaceHandlerRegistry.getNamespaceHandlers(nsuris, clientBundle);
+ try {
+ if (validate) {
+ parser.validate(nshandlers.getSchema());
+ }
+ cdr = new ComponentDefinitionRegistryImpl();
+ parser.populate(nshandlers, cdr);
+ } finally {
+ nshandlers.destroy();
}
- cdr = new ComponentDefinitionRegistryImpl();
- parser.populate(nshandlers, cdr);
- } finally {
- nshandlers.destroy();
- }
-
- return cdr;
- }
+
+ return cdr;
+ }
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java Wed Jan 31 20:10:03 2018
@@ -23,34 +23,29 @@ import java.lang.reflect.Method;
import org.apache.aries.blueprint.Interceptor;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-public class QuiesceInterceptor implements Interceptor{
+public class QuiesceInterceptor implements Interceptor {
- private ServiceRecipe serviceRecipe;
-
- public QuiesceInterceptor(ServiceRecipe serviceRecipe)
- {
- this.serviceRecipe = serviceRecipe;
- }
-
- public Object preCall(ComponentMetadata cm, Method m, Object... parameters) throws Throwable
- {
- serviceRecipe.incrementActiveCalls();
-
- return null;
+ private ServiceRecipe serviceRecipe;
+
+ public QuiesceInterceptor(ServiceRecipe serviceRecipe) {
+ this.serviceRecipe = serviceRecipe;
+ }
+
+ public Object preCall(ComponentMetadata cm, Method m, Object... parameters) throws Throwable {
+ serviceRecipe.incrementActiveCalls();
+
+ return null;
}
-
- public void postCallWithReturn(ComponentMetadata cm, Method m, Object returnType, Object preCallToken) throws Throwable
- {
- serviceRecipe.decrementActiveCalls();
+
+ public void postCallWithReturn(ComponentMetadata cm, Method m, Object returnType, Object preCallToken) throws Throwable {
+ serviceRecipe.decrementActiveCalls();
}
- public void postCallWithException(ComponentMetadata cm, Method m, Throwable ex, Object preCallToken) throws Throwable
- {
- serviceRecipe.decrementActiveCalls();
+ public void postCallWithException(ComponentMetadata cm, Method m, Throwable ex, Object preCallToken) throws Throwable {
+ serviceRecipe.decrementActiveCalls();
}
-
- public int getRank()
- {
- return 0;
+
+ public int getRank() {
+ return 0;
}
}
Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceListRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceListRecipe.java?rev=1822826&r1=1822825&r2=1822826&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceListRecipe.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ReferenceListRecipe.java Wed Jan 31 20:10:03 2018
@@ -201,11 +201,11 @@ public class ReferenceListRecipe extends
if (bundle != null) {
BundleContext ctx = getBundleContextForServiceLookup();
if (ctx != null) {
- try {
- ctx.ungetService(ref);
- } catch (IllegalStateException ise) {
- // we don't care it doesn't exist so, shrug.
- }
+ try {
+ ctx.ungetService(ref);
+ } catch (IllegalStateException ise) {
+ // we don't care it doesn't exist so, shrug.
+ }
}
}
}