svn commit: r1693428 - in /felix/trunk/configadmin/src: main/java/org/apache/felix/cm/file/FilePersistenceManager.java main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java test/java/org/apac
Author: cziegeler Date: Thu Jul 30 14:07:38 2015 New Revision: 1693428 URL: http://svn.apache.org/r1693428 Log: FELIX-4945 : Escaped folder names makes ConfigAdmin incompatible and factory configs not always work. Apply patch from Balazs Zsoldos Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/file/FilePersistenceManager.java felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java felix/trunk/configadmin/src/test/java/org/apache/felix/cm/file/FilePersistenceManagerTest.java Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/file/FilePersistenceManager.java URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/file/FilePersistenceManager.java?rev=1693428r1=1693427r2=1693428view=diff == --- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/file/FilePersistenceManager.java (original) +++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/file/FilePersistenceManager.java Thu Jul 30 14:07:38 2015 @@ -144,16 +144,6 @@ public class FilePersistenceManager impl */ private final boolean isWin; -/** - * A set of three character names (prefixes) considered reserved - * on Windows platform systems. This set consists of names such as - * LPT, CON, COM, etc., which cause weird behaviour on Windows systems - * if used as prefixes on path segments. See . - * - * @see a href=https://issues.apache.org/jira/browse/FELIX-4302;FELIX-4302/a - */ -private final Set winDevNames; - // sets up this class defining the set of valid characters in path // set getFile(String) for details. static @@ -187,21 +177,37 @@ public class FilePersistenceManager impl // Windows hence we assume a Windows platform in thus case. final String osName = System.getProperty( os.name ); isWin = osName != null osName.startsWith( Windows ); -if ( isWin ) -{ -winDevNames = new HashSet(); -winDevNames.add( CON ); // keyboard and display -winDevNames.add( PRN ); // system list; generally par. port -winDevNames.add( AUX ); // auxiliary; generally ser. port -winDevNames.add( CLO ); // CLOCK$; system real time clock -winDevNames.add( NUL ); // Bit-bucket -winDevNames.add( COM ); // COM1..COMn; serial ports -winDevNames.add( LPT ); // LPT1..LPTn; parallel ports +} + +private static boolean equalsNameWithPrefixPlusOneDigit( String name, String prefix) { +if ( name.length() != prefix.length() + 1 ) { +return false; } -else -{ -winDevNames = null; +if ( !name.startsWith(prefix) ) { +return false; +} +char charAfterPrefix = name.charAt( prefix.length() ); +return charAfterPrefix '0' charAfterPrefix '9'; +} + +private static boolean isWinReservedName(String name) { +String upperCaseName = name.toUpperCase(); +if ( CON.equals( upperCaseName ) ) { +return true; +} else if ( PRN.equals( upperCaseName ) ){ +return true; +} else if ( AUX.equals( upperCaseName ) ){ +return true; +} else if ( CLOCK$.equals( upperCaseName ) ){ +return true; +} else if ( NUL.equals( upperCaseName ) ){ +return true; +} else if ( equalsNameWithPrefixPlusOneDigit( upperCaseName, COM) ) { +return true; +} else if ( equalsNameWithPrefixPlusOneDigit( upperCaseName, LPT) ){ +return true; } +return false; } @@ -403,7 +409,7 @@ public class FilePersistenceManager impl while ( segments.hasMoreTokens() ) { final String segment = segments.nextToken(); -if ( segment.length() = 3 winDevNames.contains( segment.substring( 0, 3 ).toUpperCase() ) ) +if ( isWinReservedName(segment) ) { appendEncoded( pidBuffer, segment.charAt( 0 ) ); pidBuffer.append( segment.substring( 1 ) ); Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java?rev=1693428r1=1693427r2=1693428view=diff == --- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java (original) +++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java Thu Jul 30 14:07:38 2015 @@ -20,6 +20,7 @@ package org.apache.felix.cm.impl; import java.io.IOException; + import org.osgi.framework.Bundle;
svn commit: r1693444 - in /felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal: ConfigMetaTypeProvider.java JettyConfig.java
Author: cziegeler Date: Thu Jul 30 15:37:43 2015 New Revision: 1693444 URL: http://svn.apache.org/r1693444 Log: FELIX-4981 : [Jetty] Change default behaviour of sendServerHeader from true to false Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java?rev=1693444r1=1693443r2=1693444view=diff == --- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java (original) +++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java Thu Jul 30 15:37:43 2015 @@ -216,7 +216,7 @@ class ConfigMetaTypeProvider implements adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_SEND_SERVER_HEADER, Send Server Header, If enabled, the server header is sent., -true, +false, bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_SEND_SERVER_HEADER))); adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_INCLUDED_PROTOCOLS, Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1693444r1=1693443r2=1693444view=diff == --- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java (original) +++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java Thu Jul 30 15:37:43 2015 @@ -352,7 +352,7 @@ public final class JettyConfig public boolean isSendServerHeader() { -return getBooleanProperty(FELIX_JETTY_SEND_SERVER_HEADER, true); +return getBooleanProperty(FELIX_JETTY_SEND_SERVER_HEADER, false); } /**
svn commit: r1693436 - in /felix/trunk/metatype/src/main/java/org/apache/felix/metatype: MetaDataReader.java internal/MetaTypeServiceImpl.java
Author: cziegeler Date: Thu Jul 30 15:07:54 2015 New Revision: 1693436 URL: http://svn.apache.org/r1693436 Log: FELIX-4973 : Relax exception handling when reading metatype XML Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java?rev=1693436r1=1693435r2=1693436view=diff == --- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java (original) +++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java Thu Jul 30 15:07:54 2015 @@ -81,13 +81,15 @@ public class MetaDataReader private KXmlParser parser = new KXmlParser(); private String namespace = NAMESPACE_1_0; +private URL documentURL; + /** Sets of attributes belonging to XML elements. */ -private static final Set AD_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { name, description, id, type, cardinality, min, max, default, required })); -private static final Set ATTRIBUTE_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { adref, content })); -private static final Set DESIGNATE_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { pid, factoryPid, bundle, optional, merge })); -private static final Set DESIGNATEOBJECT_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { ocdref })); -private static final Set METADATA_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { localization })); -private static final Set OCD_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { name, description, id })); +private static final SetString AD_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { name, description, id, type, cardinality, min, max, default, required })); +private static final SetString ATTRIBUTE_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { adref, content })); +private static final SetString DESIGNATE_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { pid, factoryPid, bundle, optional, merge })); +private static final SetString DESIGNATEOBJECT_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { ocdref })); +private static final SetString METADATA_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { localization })); +private static final SetString OCD_ATTRIBUTES = new HashSetString(Arrays.asList(new String[] { name, description, id })); /** * Parses the XML document provided by the codeurl/code. The XML document @@ -107,6 +109,7 @@ public class MetaDataReader */ public MetaData parse(URL url) throws IOException { +this.documentURL = url; InputStream ins = null; try { @@ -137,6 +140,7 @@ public class MetaDataReader // ignore } } +this.documentURL = null; } } @@ -637,9 +641,13 @@ public class MetaDataReader return new XmlPullParserException(message, this.parser, null); } -private void logMissingElement(String elementName) +private void logMissingElement(final String elementName) { String message = Missing element + elementName + in element + this.parser.getName(); +if ( documentURL != null ) +{ +message = message + : + this.documentURL; +} Activator.log(LogService.LOG_ERROR, message); } Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java?rev=1693436r1=1693435r2=1693436view=diff == --- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java (original) +++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java Thu Jul 30 15:07:54 2015 @@ -140,7 +140,7 @@ class MetaTypeServiceImpl implements Met } MetaTypeInformationImpl impl = null; -if ( bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STARTING ) +if ( bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STARTING || bundle.getState() == Bundle.RESOLVED ) { putMetaTypeInformationInternal( bundle, mti ); }
svn commit: r1693433 - in /felix/trunk/metatype/src: main/java/org/apache/felix/metatype/MetaDataReader.java main/java/org/apache/felix/metatype/internal/Activator.java test/java/org/apache/felix/meta
Author: cziegeler Date: Thu Jul 30 14:34:04 2015 New Revision: 1693433 URL: http://svn.apache.org/r1693433 Log: FELIX-4973 : Relax exception handling when reading metatype XML Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java?rev=1693433r1=1693432r2=1693433view=diff == --- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java (original) +++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java Thu Jul 30 14:34:04 2015 @@ -316,7 +316,8 @@ public class MetaDataReader if (getNamespaceVersion() 13 ocd.getAttributeDefinitions() == null) { // Need at least one AD in versions 1.0, 1.1 1.2... -throw missingElement(AD); +logMissingElement(AD); +ocd = null; } break; } @@ -377,7 +378,8 @@ public class MetaDataReader if (designate.getObject() == null) { // Exactly 1 Object is allowed... -throw missingElement(Object); +logMissingElement(Object); +designate = null; } break; } @@ -405,7 +407,7 @@ public class MetaDataReader readOptionalAttributes(ad, AD_ATTRIBUTES); -Map options = new LinkedHashMap(); +MapString, String options = new LinkedHashMapString, String(); int eventType = this.parser.next(); while (eventType != XmlPullParser.END_DOCUMENT) { @@ -439,7 +441,7 @@ public class MetaDataReader ad.setOptions(options); -// set value as late as possible to force an options check (FELIX-3884, FELIX-4665)... +// set value as late as possible to force an options check (FELIX-3884, FELIX-4665)... if (dfltValue != null) { ad.setDefaultValue(dfltValue); @@ -635,10 +637,10 @@ public class MetaDataReader return new XmlPullParserException(message, this.parser, null); } -private XmlPullParserException missingElement(String elementName) +private void logMissingElement(String elementName) { String message = Missing element + elementName + in element + this.parser.getName(); -return new XmlPullParserException(message, this.parser, null); +Activator.log(LogService.LOG_ERROR, message); } private XmlPullParserException unexpectedElement(String elementName) Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java?rev=1693433r1=1693432r2=1693433view=diff == --- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java (original) +++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java Thu Jul 30 14:34:04 2015 @@ -21,10 +21,16 @@ package org.apache.felix.metatype.intern import java.io.PrintStream; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Date; +import java.util.Dictionary; +import java.util.Hashtable; import org.apache.felix.metatype.internal.l10n.BundleResources; -import org.osgi.framework.*; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceReference; import org.osgi.service.log.LogService; import org.osgi.service.metatype.MetaTypeService; import org.osgi.util.tracker.ServiceTracker; @@ -126,7 +132,7 @@ public class Activator implements Bundle public static void log( int level, String message ) { -LogService log = ( LogService ) INSTANCE.logService.getService(); +final LogService log = (INSTANCE == null ? null : ( LogService ) INSTANCE.logService.getService()); if ( log == null ) { _log( null, level, message, null ); @@ -140,7 +146,7 @@ public class Activator implements Bundle public static void log( int level, String message, Throwable exception ) { -LogService log = ( LogService ) INSTANCE.logService.getService(); +final
svn commit: r960176 - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/apache-felix-http-service.html
Author: buildbot Date: Thu Jul 30 15:18:13 2015 New Revision: 960176 Log: Staging update by buildbot for felix Modified: websites/staging/felix/trunk/content/ (props changed) websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-http-service.html Propchange: websites/staging/felix/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Thu Jul 30 15:18:13 2015 @@ -1 +1 @@ -1690683 +1693437 Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-http-service.html == --- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-http-service.html (original) +++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-http-service.html Thu Jul 30 15:18:13 2015 @@ -39,7 +39,18 @@ /div div class=menu - pa href=/news.htmlnews/a br / + style type=text/css +/* The following code is added by mdx_elementid.py + It was originally lifted from http://subversion.apache.org/style/site.css */ +/* + * Hide class=elementid-permalink, except when an enclosing heading + * has the :hover property. + */ +.headerlink, .elementid-permalink { + visibility: hidden; +} +h2:hover .headerlink, h3:hover .headerlink, h1:hover .headerlink, h6:hover .headerlink, h4:hover .headerlink, h5:hover .headerlink, dt:hover .elementid-permalink { visibility: visible }/style +pa href=/news.htmlnews/a br / a href=/license.htmllicense/a br / a href=/downloads.cgidownloads/a br / a href=/documentation.htmldocumentation/a br / @@ -66,7 +77,18 @@ /div h1Apache Felix HTTP Service/h1 - div class=toc + style type=text/css +/* The following code is added by mdx_elementid.py + It was originally lifted from http://subversion.apache.org/style/site.css */ +/* + * Hide class=elementid-permalink, except when an enclosing heading + * has the :hover property. + */ +.headerlink, .elementid-permalink { + visibility: hidden; +} +h2:hover .headerlink, h3:hover .headerlink, h1:hover .headerlink, h6:hover .headerlink, h4:hover .headerlink, h5:hover .headerlink, dt:hover .elementid-permalink { visibility: visible }/style +div class=toc ul lia href=#installingInstalling/a/li lia href=#using-the-httpserviceUsing the HttpService/a/li @@ -105,7 +127,7 @@ implementation. Complete set of features liOne complete bundle that includes everything to simplify deployment;/li liCorrectly versioned Servlet API./li /ul -h2 id=installingInstalling/h2 +h2 id=installingInstallinga class=headerlink href=#installing title=Permanent linkpara;/a/h2 pThe Apache Felix HTTP Service project includes several bundles. /p ul licodeorg.apache.felix.http.servlet-api/code - Provides the Servlet API (versions 2.6 and 3.0 of the Servlet specification);/li @@ -125,7 +147,7 @@ classpath and deployment!/p pSo, in most cases you could just use strongorg.apache.felix.http.bundle/strong and forget about all the other ones. Note that emby default/em, this bundle operates in bridged mode and needs explicit configuration to enable or operate in other modes. See a href=#using-the-all-in-one-bundlethis section/a for more information./p -h2 id=using-the-httpserviceUsing the HttpService/h2 +h2 id=using-the-httpserviceUsing the HttpServicea class=headerlink href=#using-the-httpservice title=Permanent linkpara;/a/h2 pThe main components provided by the Apache Felix HTTP Service bundle are:/p ul licodeHttpService/code - Service used to dynamically register resources and servlets;/li @@ -290,7 +312,7 @@ or the correct MIME type implementing th /pre/div -h2 id=using-the-exthttpserviceUsing the ExtHttpService/h2 +h2 id=using-the-exthttpserviceUsing the ExtHttpServicea class=headerlink href=#using-the-exthttpservice title=Permanent linkpara;/a/h2 pTo be able to register filters, it is possible to get hold of codeorg.apache.felix.http.api.ExtHttpService/code. This service is exported by both Jetty and the bridged implementation. Let's see an example of how you would register a filter:/p div class=codehiliteprespan class=kdpublic/span span class=kdclass/span span class=ncActivator/span span class=kdimplements/span span class=nBundleActivator/span span class=o{/span @@ -330,7 +352,7 @@ is exported by both Jetty and the bridge /pre/div -h2 id=using-the-whiteboardUsing the Whiteboard/h2 +h2 id=using-the-whiteboardUsing the Whiteboarda class=headerlink href=#using-the-whiteboard title=Permanent linkpara;/a/h2 pThe whiteboard implementation simplifies the task of registering servlets and filters. A servlet (or filter) can be registered by exporting it as a service, making it no longer necessary to track and use the codeHttpService/code directly. The whiteboard implementation detects all codejavax.servlet.Servlet/code,
buildbot success in ASF Buildbot on felix-site-staging
The Buildbot has detected a restored build on builder felix-site-staging while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/felix-site-staging/builds/2 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The AnyBranchScheduler scheduler named 'on-felix-site-commit' triggered this build Build Source Stamp: [branch felix/site] 1693437 Blamelist: cziegeler Build succeeded! Sincerely, -The Buildbot
svn commit: r1693437 - /felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext
Author: cziegeler Date: Thu Jul 30 15:17:33 2015 New Revision: 1693437 URL: http://svn.apache.org/r1693437 Log: Correct felix docs Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext?rev=1693437r1=1693436r2=1693437view=diff == --- felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext (original) +++ felix/site/trunk/content/documentation/subprojects/apache-felix-http-service.mdtext Thu Jul 30 15:17:33 2015 @@ -384,7 +384,7 @@ properties can be used (some legacy prop | `org.apache.felix.http.jetty.responseBufferSize` | Size of the buffer for responses, in bytes. Default is 24 KB. | | `org.apache.felix.http.jetty.maxFormSize` | The maximum size accepted for a form post, in bytes. Defaults to 200 KB. | | `org.apache.felix.http.mbeans` | If `true`, enables the MBean server functionality. The default is `false`. | -| `org.apache.felix.http.jetty.sendServerHeader` | If `false`, the `Server` HTTP header is no longer included in responses. The default is `false`. | +| `org.apache.felix.http.jetty.sendServerHeader` | If `false`, the `Server` HTTP header is no longer included in responses. The default is `true`. | | `org.eclipse.jetty.servlet.SessionCookie` | Name of the cookie used to transport the Session ID. The default is `JSESSIONID`. | | `org.eclipse.jetty.servlet.SessionURL` | Name of the request parameter to transport the Session ID. The default is `jsessionid`. | | `org.eclipse.jetty.servlet.SessionDomain` | Domain to set on the session cookie. The default is `null`. |
svn commit: r1693443 - /felix/trunk/http/parent/pom.xml
Author: cziegeler Date: Thu Jul 30 15:33:50 2015 New Revision: 1693443 URL: http://svn.apache.org/r1693443 Log: Update to latest Jetty version Modified: felix/trunk/http/parent/pom.xml Modified: felix/trunk/http/parent/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/http/parent/pom.xml?rev=1693443r1=1693442r2=1693443view=diff == --- felix/trunk/http/parent/pom.xml (original) +++ felix/trunk/http/parent/pom.xml Thu Jul 30 15:33:50 2015 @@ -39,7 +39,7 @@ properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding - jetty.version9.2.9.v20150224/jetty.version + jetty.version9.2.12.v20150709/jetty.version cometd.version2.8.0/cometd.version servlet.version3.1.0/servlet.version !--
svn commit: r960178 - /websites/production/felix/content/
Author: cziegeler Date: Thu Jul 30 15:23:03 2015 New Revision: 960178 Log: Publishing svnmucc operation to felix site by cziegeler Added: websites/production/felix/content/ - copied from r960177, websites/staging/felix/trunk/content/
svn commit: r1693390 - /felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java
Author: cziegeler Date: Thu Jul 30 06:25:40 2015 New Revision: 1693390 URL: http://svn.apache.org/r1693390 Log: FELIX-4979 : [Jetty] String array properties are not parsed correctly when supplied through framework properties. Fix metatype generation Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java?rev=1693390r1=1693389r2=1693390view=diff == --- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java (original) +++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/ConfigMetaTypeProvider.java Thu Jul 30 06:25:40 2015 @@ -193,7 +193,7 @@ class ConfigMetaTypeProvider implements new String[] {/system}, 2147483647, null, null, - bundle.getBundleContext().getProperty(JettyConfig.FELIX_HTTP_PATH_EXCLUSIONS))); + getStringArray(bundle.getBundleContext().getProperty(JettyConfig.FELIX_HTTP_PATH_EXCLUSIONS; adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_EXCLUDED_SUITES, Excluded Cipher Suites, @@ -202,7 +202,7 @@ class ConfigMetaTypeProvider implements null, 2147483647, null, null, - bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_EXCLUDED_SUITES))); + getStringArray(bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_EXCLUDED_SUITES; adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_INCLUDED_SUITES, Included Cipher Suites, @@ -211,7 +211,7 @@ class ConfigMetaTypeProvider implements null, 2147483647, null, null, - bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_INCLUDED_SUITES))); + getStringArray(bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_INCLUDED_SUITES; adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_SEND_SERVER_HEADER, Send Server Header, @@ -229,7 +229,7 @@ class ConfigMetaTypeProvider implements null, 2147483647, null, null, - bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_INCLUDED_PROTOCOLS))); + getStringArray(bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_INCLUDED_PROTOCOLS; adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_JETTY_EXCLUDED_PROTOCOLS, Excluded Protocols, @@ -241,7 +241,7 @@ class ConfigMetaTypeProvider implements null, 2147483647, null, null, - bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_EXCLUDED_PROTOCOLS))); + getStringArray(bundle.getBundleContext().getProperty(JettyConfig.FELIX_JETTY_EXCLUDED_PROTOCOLS; adList.add(new AttributeDefinitionImpl(JettyConfig.FELIX_PROXY_LOAD_BALANCER_CONNECTION_ENABLE, Enable Proxy/Load Balancer Connection, @@ -290,6 +290,15 @@ class ConfigMetaTypeProvider implements }; } +private String [] getStringArray(final String value) +{ +if ( value != null ) +{ +return value.trim().split(,); +} +return null; +} + private static class AttributeDefinitionImpl implements AttributeDefinition { @@ -305,33 +314,41 @@ class ConfigMetaTypeProvider implements AttributeDefinitionImpl( final String id, final String name, final String description, final String defaultValue, final String overrideValue ) { -this( id, name, description, STRING, defaultValue == null ? null : new String[] { defaultValue }, 0, null, null, overrideValue ); +this( id, name, description, STRING, defaultValue == null ? null : new String[] { defaultValue }, 0, null, null, overrideValue == null ? null : new String[] { overrideValue } ); } AttributeDefinitionImpl( final String id, final String name, final String description, final int defaultValue, final String overrideValue ) { this( id, name, description, INTEGER, new String[] -{ String.valueOf(defaultValue) }, 0, null, null, overrideValue ); +{ String.valueOf(defaultValue) }, 0, null, null, overrideValue == null ? null : new String[] { overrideValue } ); } AttributeDefinitionImpl( final String id, final String name, final String description, final
svn commit: r1693389 - in /felix/trunk/http/jetty/src: main/java/org/apache/felix/http/jetty/internal/JettyConfig.java test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
Author: cziegeler Date: Thu Jul 30 06:18:08 2015 New Revision: 1693389 URL: http://svn.apache.org/r1693389 Log: FELIX-4979 : [Jetty] String array properties are not parsed correctly when supplied through framework properties. Apply patch from Adrien Pailhes Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1693389r1=1693388r2=1693389view=diff == --- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java (original) +++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java Thu Jul 30 06:18:08 2015 @@ -551,7 +551,7 @@ public final class JettyConfig final String stringVal = ((String) value).trim(); if (stringVal.length() 0) { -return new String[] { stringVal }; +return stringVal.split(,); } } else if (value instanceof String[]) Modified: felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java?rev=1693389r1=1693388r2=1693389view=diff == --- felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java (original) +++ felix/trunk/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java Thu Jul 30 06:18:08 2015 @@ -18,6 +18,7 @@ package org.apache.felix.http.jetty.inte import static org.easymock.EasyMock.createNiceMock; import static org.easymock.EasyMock.replay; +import static org.junit.Assert.assertArrayEquals; import java.util.Hashtable; @@ -113,6 +114,15 @@ public class JettyConfigTest extends Tes assertTrue(this.config.getHttpsPort() == port); } +public void testParseStringArrayProperty() { +HashtableString, Object props = new Hashtable(); +props.put(org.apache.felix.https.jetty.ciphersuites.excluded, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_anon_WITH_RC4_128_SHA); +this.config.update(props); +String[] expecteds = {TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_anon_WITH_RC4_128_SHA}; +assertArrayEquals(expecteds, this.config.getExcludedCipherSuites()); +} + @Override protected void setUp() { @@ -120,4 +130,4 @@ public class JettyConfigTest extends Tes replay(this.context); this.config = new JettyConfig(this.context); } -} \ No newline at end of file +}
svn commit: r1693463 - /felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java
Author: pderop Date: Thu Jul 30 18:05:23 2015 New Revision: 1693463 URL: http://svn.apache.org/r1693463 Log: added debug code that dumps stacktraces when A is bound to B twice. Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java?rev=1693463r1=1693462r2=1693463view=diff == --- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java (original) +++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/src/org/apache/felix/scr/integration/CircularReferenceTest.java Thu Jul 30 18:05:23 2015 @@ -122,7 +122,7 @@ public class CircularReferenceTest exten delay(); A a = getServiceFromConfiguration(componentA, A.class); -assertEquals( 1, a.getBs().size()); +assertABoundToOneB(a); delay(); //async binding of a to b after circular ref detected B b = getServiceFromConfiguration(componentB, B.class); assertEquals( 1, b.getAs().size() ); @@ -153,7 +153,7 @@ public class CircularReferenceTest exten delay(); A a = getServiceFromConfiguration(componentA, A.class); -assertEquals( 1, a.getBs().size()); +assertABoundToOneB(a); B b = getServiceFromConfiguration(componentB, B.class); assertEquals( 1, b.getAs().size() ); @@ -227,7 +227,7 @@ public class CircularReferenceTest exten delay(); A a = getServiceFromConfiguration(componentA, A.class); -assertEquals( 1, a.getBs().size()); +assertABoundToOneB(a); B b = getServiceFromConfiguration(componentB, B.class); assertEquals( 1, b.getAs().size() ); } @@ -258,12 +258,7 @@ public class CircularReferenceTest exten delay(); A a = getServiceFromConfiguration(componentA, A.class); -// TODO remove -if (a.getBs().size() != 1) { -System.err.println(detected problem ...); -a.dumpStackTracesWhenBWasBound(); -} -assertEquals( 1, a.getBs().size()); +assertABoundToOneB(a); B b = getServiceFromConfiguration(componentB, B.class); assertEquals( 1, b.getAs().size() ); @@ -281,6 +276,13 @@ public class CircularReferenceTest exten assertEquals( 1, a.getBs().size()); b = getServiceFromConfiguration(componentB, B.class); assertEquals( 1, b.getAs().size() ); - +} + +private void assertABoundToOneB(A a) { +if (a.getBs().size() != 1) { +System.err.println(detected problem ...); +a.dumpStackTracesWhenBWasBound(); +} +assertEquals( 1, a.getBs().size()); } }
svn commit: r1693406 - in /felix/trunk/framework/src: main/java/org/apache/felix/framework/ServiceRegistry.java test/java/org/apache/felix/framework/ServiceRegistryTest.java
Author: davidb Date: Thu Jul 30 10:38:25 2015 New Revision: 1693406 URL: http://svn.apache.org/r1693406 Log: FELIX-4977 Fix for concurrency issue with factory services This commit fixes the issue in nearly all cases. Very occasionally the testGetUngetServiceFactory() test still reports 1 violation (down from the hundreds we were getting). Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java felix/trunk/framework/src/test/java/org/apache/felix/framework/ServiceRegistryTest.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java?rev=1693406r1=1693405r2=1693406view=diff == --- felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java Thu Jul 30 10:38:25 2015 @@ -317,17 +317,17 @@ public class ServiceRegistry // Increment the usage count and grab the already retrieved // service object, if one exists. -checkCountOverflow(usage.m_count.incrementAndGet()); - +incrementToPositiveValue(usage.m_count); svcObj = usage.getService(); + if ( isServiceObjects ) { - checkCountOverflow(usage.m_serviceObjectsCount.incrementAndGet()); +incrementToPositiveValue(usage.m_serviceObjectsCount); } // If we have a usage count, but no service object, then we haven't // cached the service object yet, so we need to create one. -if ((usage != null) (svcObj == null)) +if (usage != null) { ServiceHolder holder = null; @@ -379,6 +379,21 @@ public class ServiceRegistry return (S) svcObj; } +// Increment the Atomic Long by 1, and ensure the result is at least 1. +private void incrementToPositiveValue(AtomicLong al) +{ +boolean success = false; + +while (!success) +{ +long oldVal = al.get(); +long newVal = Math.max(oldVal + 1L, 1L); +checkCountOverflow(newVal); + +success = al.compareAndSet(oldVal, newVal); +} +} + private void checkCountOverflow(long c) { if (c == Long.MAX_VALUE) @@ -442,9 +457,10 @@ public class ServiceRegistry .getRegistration().ungetService(bundle, svc); } - } } + +return count = 0; } finally { @@ -455,7 +471,7 @@ public class ServiceRegistry // If the registration is invalid or the usage count has reached // zero, then flush it. -if (count = 0 || !reg.isValid()) +if (!reg.isValid()) { flushUsageCount(bundle, ref, usage); } @@ -465,8 +481,6 @@ public class ServiceRegistry { reg.unmarkCurrentThread(); } - -return true; } @@ -492,6 +506,9 @@ public class ServiceRegistry // service cache. for (int i = 0; i usages.length; i++) { +if (usages[i].m_svcHolderRef.get() == null) +continue; + // Keep ungetting until all usage count is zero. while (ungetService(bundle, usages[i].m_ref, usages[i].m_prototype ? usages[i].getService() : null)) { Modified: felix/trunk/framework/src/test/java/org/apache/felix/framework/ServiceRegistryTest.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/test/java/org/apache/felix/framework/ServiceRegistryTest.java?rev=1693406r1=1693405r2=1693406view=diff == --- felix/trunk/framework/src/test/java/org/apache/felix/framework/ServiceRegistryTest.java (original) +++ felix/trunk/framework/src/test/java/org/apache/felix/framework/ServiceRegistryTest.java Thu Jul 30 10:38:25 2015 @@ -31,6 +31,8 @@ import java.util.concurrent.ConcurrentMa import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; +import junit.framework.TestCase; + import org.apache.felix.framework.ServiceRegistrationImpl.ServiceReferenceImpl; import org.apache.felix.framework.ServiceRegistry.ServiceHolder; import org.apache.felix.framework.ServiceRegistry.UsageCount; @@ -51,8 +53,6 @@ import org.osgi.framework.hooks.service. import org.osgi.framework.hooks.service.FindHook; import org.osgi.framework.hooks.service.ListenerHook; -import junit.framework.TestCase; -