You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ga...@apache.org on 2010/01/15 07:35:08 UTC
svn commit: r899541 - in /incubator/aries/trunk:
application/application-api/src/main/java/org/apache/aries/application/
application/application-utils/src/main/java/org/apache/aries/application/utils/
application/application-utils/src/main/java/org/apa...
Author: gawor
Date: Fri Jan 15 06:35:07 2010
New Revision: 899541
URL: http://svn.apache.org/viewvc?rev=899541&view=rev
Log:
add missing license headers and svn:eol-style properties
Modified:
incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java (contents, props changed)
incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java (contents, props changed)
incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestDefaultsInjector.java
incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java (contents, props changed)
incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java
incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/codec/PackageData.java
incubator/aries/trunk/jpa/jpa-container/pom.xml
incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/util/FakeManagedPersistenceUnitFactory.java
incubator/aries/trunk/jpa/pom.xml
Modified: incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java (original)
+++ incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java Fri Jan 15 06:35:07 2010
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.aries.application;
-
-import org.osgi.framework.Filter;
-
-public interface ServiceDeclaration {
-
- /**
- * get the interface name for the service
- * @return
- */
- public abstract String getInterfaceName();
-
- /**
- * get the filter for the service
- * @return the filter for the service or null if there is no filter defined
- */
- public abstract Filter getFilter();
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.application;
+
+import org.osgi.framework.Filter;
+
+public interface ServiceDeclaration {
+
+ /**
+ * get the interface name for the service
+ * @return
+ */
+ public abstract String getInterfaceName();
+
+ /**
+ * get the filter for the service
+ * @return the filter for the service or null if there is no filter defined
+ */
+ public abstract Filter getFilter();
+
}
Propchange: incubator/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/ServiceDeclaration.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java (original)
+++ incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java Fri Jan 15 06:35:07 2010
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.aries.application.utils;
-
-
-/**
- * Widely used constants in parsing Aries applications
- */
-public interface AppConstants
-{
- /** Trace group for this bundle */
- public String TRACE_GROUP = "Aries.app.utils";
-
- /** The application scope (used to find the applications bundle repository */
- public static final String APPLICATION_SCOPE = "Application-Scope";
- /** The application content directive for the application manifest */
- public static final String APPLICATION_CONTENT = "Application-Content";
- /** The application version directive for the application manifest */
- public static final String APPLICATION_VERSION = "Application-Version";
- /** The application name directive for the application manifest */
- public static final String APPLICATION_NAME = "Application-Name";
- /** The application symbolic name directive for the application manifest */
- public static final String APPLICATION_SYMBOLIC_NAME = "Application-SymbolicName";
- /** The default version for applications that do not have one */
- public static final String DEFAULT_VERSION = "0.0.0";
- /** The name of the application manifest in the application */
- public static final String APPLICATION_MF = "META-INF/APPLICATION.MF";
- /** The name of the deployment manifest in the application */
- public static final String DEPLOYMENT_MF = "META-INF/DEPLOYMENT.MF";
- /** The name of the META-INF directory */
- public static final String META_INF = "META-INF";
- /** The name of an application.xml file which will be used in processing legacy .war files */
- public static final String APPLICATION_XML = "META-INF/application.xml";
- /** The expected lower case suffix of a jar file */
- public static final String LOWER_CASE_JAR_SUFFIX = ".jar";
- /** The expected lower case suffix of a war file */
- public static final String LOWER_CASE_WAR_SUFFIX = ".war";
- /** The attribute used to record the deployed version of a bundle */
- public static final String DEPLOYMENT_BUNDLE_VERSION = "deployed-version";
- /** The name of the bundle manifest */
- public static final String MANIFEST_MF = "META-INF/MANIFEST.MF";
-
- public static final String MANIFEST_VERSION="1.0";
-
- /* The Deployed-Content header in DEPLOYMENT.MF records all the bundles
- * to be deployed for a particular application.
- */
- public static final String DEPLOYMENT_CONTENT = "Deployed-Content";
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.application.utils;
+
+
+/**
+ * Widely used constants in parsing Aries applications
+ */
+public interface AppConstants
+{
+ /** Trace group for this bundle */
+ public String TRACE_GROUP = "Aries.app.utils";
+
+ /** The application scope (used to find the applications bundle repository */
+ public static final String APPLICATION_SCOPE = "Application-Scope";
+ /** The application content directive for the application manifest */
+ public static final String APPLICATION_CONTENT = "Application-Content";
+ /** The application version directive for the application manifest */
+ public static final String APPLICATION_VERSION = "Application-Version";
+ /** The application name directive for the application manifest */
+ public static final String APPLICATION_NAME = "Application-Name";
+ /** The application symbolic name directive for the application manifest */
+ public static final String APPLICATION_SYMBOLIC_NAME = "Application-SymbolicName";
+ /** The default version for applications that do not have one */
+ public static final String DEFAULT_VERSION = "0.0.0";
+ /** The name of the application manifest in the application */
+ public static final String APPLICATION_MF = "META-INF/APPLICATION.MF";
+ /** The name of the deployment manifest in the application */
+ public static final String DEPLOYMENT_MF = "META-INF/DEPLOYMENT.MF";
+ /** The name of the META-INF directory */
+ public static final String META_INF = "META-INF";
+ /** The name of an application.xml file which will be used in processing legacy .war files */
+ public static final String APPLICATION_XML = "META-INF/application.xml";
+ /** The expected lower case suffix of a jar file */
+ public static final String LOWER_CASE_JAR_SUFFIX = ".jar";
+ /** The expected lower case suffix of a war file */
+ public static final String LOWER_CASE_WAR_SUFFIX = ".war";
+ /** The attribute used to record the deployed version of a bundle */
+ public static final String DEPLOYMENT_BUNDLE_VERSION = "deployed-version";
+ /** The name of the bundle manifest */
+ public static final String MANIFEST_MF = "META-INF/MANIFEST.MF";
+
+ public static final String MANIFEST_VERSION="1.0";
+
+ /* The Deployed-Content header in DEPLOYMENT.MF records all the bundles
+ * to be deployed for a particular application.
+ */
+ public static final String DEPLOYMENT_CONTENT = "Deployed-Content";
}
Propchange: incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/AppConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestDefaultsInjector.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestDefaultsInjector.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestDefaultsInjector.java (original)
+++ incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestDefaultsInjector.java Fri Jan 15 06:35:07 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.aries.application.utils.manifest;
import java.io.File;
Modified: incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java (original)
+++ incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java Fri Jan 15 06:35:07 2010
@@ -1,201 +1,201 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.aries.application.utils.manifest;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.apache.aries.application.filesystem.IDirectory;
-import org.apache.aries.application.filesystem.IFile;
-
-/**
- * This class contains utilities for parsing manifests. It provides methods to
- * parse the manifest, read a manifest into a map and to split an manifest
- * entry that follows the Import-Package syntax.
- */
-public class ManifestProcessor
-{
- /**
- * Reads a manifest's main attributes into a String->String map.
- * <p>
- * Will always return a map, empty if the manifest had no attributes.
- *
- * @param mf The manifest to read.
- * @return Map of manifest main attributes.
- */
- public static Map<String, String> readManifestIntoMap(Manifest mf){
-
- HashMap<String, String> props = new HashMap<String, String>();
-
- Attributes mainAttrs = mf.getMainAttributes();
- if (mainAttrs!=null){
- Set<Entry<Object, Object>> attributeSet = mainAttrs.entrySet();
- if (attributeSet != null){
- // Copy all the manifest headers across. The entry set should be a set of
- // Name to String mappings, by calling String.valueOf we do the conversion
- // to a string and we do not NPE.
- for (Map.Entry<Object, Object> entry : attributeSet) {
- props.put(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
- }
- }
- }
-
- return props;
- }
-
- /**
- * This method parses the manifest using a custom manifest parsing routine.
- * This means that we can avoid the 76 byte line length in a manifest providing
- * a better developer experience.
- *
- * @param in the input stream to read the manifest from.
- * @return the parsed manifest
- * @throws IOException
- */
- public static Manifest parseManifest(InputStream in) throws IOException
- {
- Manifest man = new Manifest();
-
- // I'm assuming that we use UTF-8 here, but the jar spec doesn't say.
- BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
-
- String line;
- StringBuilder attribute = null;
-
- String namedAttribute = null;
-
- do {
- line = reader.readLine();
-
- // if we get a blank line skip to the next one
- if (line != null && line.trim().length() == 0) continue;
- if (line != null && line.charAt(0) == ' ' && attribute != null) {
- // we have a continuation line, so add to the builder, ignoring the
- // first character
- attribute.append(line.trim());
- } else if (attribute == null) {
- attribute = new StringBuilder(line.trim());
- } else if (attribute != null) {
- // We have fully parsed an attribute
- int index = attribute.indexOf(":");
- String attributeName = attribute.substring(0, index).trim();
- // TODO cope with index + 1 being after the end of attribute
- String attributeValue = attribute.substring(index + 1).trim();
-
- if ("Name".equals(attributeName)) {
- man.getEntries().put(attributeValue, new Attributes());
- namedAttribute = attributeValue;
- } else {
- if (namedAttribute == null) {
- man.getMainAttributes().put(new Attributes.Name(attributeName), attributeValue);
- } else {
- man.getAttributes(namedAttribute).put(new Attributes.Name(attributeName), attributeValue);
- }
- }
-
- if (line != null) attribute = new StringBuilder(line.trim());
- }
- } while (line != null);
-
- return man;
- }
-
- /**
- * Obtain a manifest from an IDirectory.
- *
- * @param appDir
- * @param manifestName the name of manifest
- * @return Manifest, or null if none found.
- * @throws IOException
- */
- public static Manifest obtainManifestFromAppDir(IDirectory appDir, String manifestName) throws IOException{
- IFile manifestFile = appDir.getFile(manifestName);
- Manifest man = null;
- if (manifestFile != null) {
- man = parseManifest(manifestFile.open());
- }
- return man;
- }
-
-
- /**
- *
- * Splits a delimiter separated string, tolerating presence of non separator commas
- * within double quoted segments.
- *
- * Eg.
- * com.ibm.ws.eba.helloWorldService;version="[1.0.0, 1.0.0]" &
- * com.ibm.ws.eba.helloWorldService;version="1.0.0"
- * com.ibm.ws.eba.helloWorld;version="2";bundle-version="[2,30)"
- * com.acme.foo;weirdAttr="one;two;three";weirdDir:="1;2;3"
- * @param value the value to be split
- * @param delimiter the delimiter string such as ',' etc.
- * @return List<String> the components of the split String in a list
- */
- public static List<String> split(String value, String delimiter)
- {
-
- List<String> result = new ArrayList<String>();
- if (value != null) {
- String[] packages = value.split(delimiter);
-
- for (int i = 0; i < packages.length; ) {
- String tmp = packages[i++].trim();
- // if there is a odd number of " in a string, we need to append
- while (count(tmp, "\"") % 2 == 1) {
- // check to see if we need to append the next package[i++]
- tmp = tmp + delimiter + packages[i++].trim();
- }
-
- result.add(tmp);
- }
- }
-
- return result;
- }
-
- /**
- * count the number of characters in a string
- * @param parent The string to be searched
- * @param subString The substring to be found
- * @return the number of occurrence of the subString
- */
- private static int count(String parent, String subString) {
-
- int count = 0 ;
- int i = parent.indexOf(subString);
- while (i > -1) {
- if (parent.length() >= i+1)
- parent = parent.substring(i+1);
- count ++;
- i = parent.indexOf(subString);
- }
- return count;
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.application.utils.manifest;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import org.apache.aries.application.filesystem.IDirectory;
+import org.apache.aries.application.filesystem.IFile;
+
+/**
+ * This class contains utilities for parsing manifests. It provides methods to
+ * parse the manifest, read a manifest into a map and to split an manifest
+ * entry that follows the Import-Package syntax.
+ */
+public class ManifestProcessor
+{
+ /**
+ * Reads a manifest's main attributes into a String->String map.
+ * <p>
+ * Will always return a map, empty if the manifest had no attributes.
+ *
+ * @param mf The manifest to read.
+ * @return Map of manifest main attributes.
+ */
+ public static Map<String, String> readManifestIntoMap(Manifest mf){
+
+ HashMap<String, String> props = new HashMap<String, String>();
+
+ Attributes mainAttrs = mf.getMainAttributes();
+ if (mainAttrs!=null){
+ Set<Entry<Object, Object>> attributeSet = mainAttrs.entrySet();
+ if (attributeSet != null){
+ // Copy all the manifest headers across. The entry set should be a set of
+ // Name to String mappings, by calling String.valueOf we do the conversion
+ // to a string and we do not NPE.
+ for (Map.Entry<Object, Object> entry : attributeSet) {
+ props.put(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
+ }
+ }
+ }
+
+ return props;
+ }
+
+ /**
+ * This method parses the manifest using a custom manifest parsing routine.
+ * This means that we can avoid the 76 byte line length in a manifest providing
+ * a better developer experience.
+ *
+ * @param in the input stream to read the manifest from.
+ * @return the parsed manifest
+ * @throws IOException
+ */
+ public static Manifest parseManifest(InputStream in) throws IOException
+ {
+ Manifest man = new Manifest();
+
+ // I'm assuming that we use UTF-8 here, but the jar spec doesn't say.
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+
+ String line;
+ StringBuilder attribute = null;
+
+ String namedAttribute = null;
+
+ do {
+ line = reader.readLine();
+
+ // if we get a blank line skip to the next one
+ if (line != null && line.trim().length() == 0) continue;
+ if (line != null && line.charAt(0) == ' ' && attribute != null) {
+ // we have a continuation line, so add to the builder, ignoring the
+ // first character
+ attribute.append(line.trim());
+ } else if (attribute == null) {
+ attribute = new StringBuilder(line.trim());
+ } else if (attribute != null) {
+ // We have fully parsed an attribute
+ int index = attribute.indexOf(":");
+ String attributeName = attribute.substring(0, index).trim();
+ // TODO cope with index + 1 being after the end of attribute
+ String attributeValue = attribute.substring(index + 1).trim();
+
+ if ("Name".equals(attributeName)) {
+ man.getEntries().put(attributeValue, new Attributes());
+ namedAttribute = attributeValue;
+ } else {
+ if (namedAttribute == null) {
+ man.getMainAttributes().put(new Attributes.Name(attributeName), attributeValue);
+ } else {
+ man.getAttributes(namedAttribute).put(new Attributes.Name(attributeName), attributeValue);
+ }
+ }
+
+ if (line != null) attribute = new StringBuilder(line.trim());
+ }
+ } while (line != null);
+
+ return man;
+ }
+
+ /**
+ * Obtain a manifest from an IDirectory.
+ *
+ * @param appDir
+ * @param manifestName the name of manifest
+ * @return Manifest, or null if none found.
+ * @throws IOException
+ */
+ public static Manifest obtainManifestFromAppDir(IDirectory appDir, String manifestName) throws IOException{
+ IFile manifestFile = appDir.getFile(manifestName);
+ Manifest man = null;
+ if (manifestFile != null) {
+ man = parseManifest(manifestFile.open());
+ }
+ return man;
+ }
+
+
+ /**
+ *
+ * Splits a delimiter separated string, tolerating presence of non separator commas
+ * within double quoted segments.
+ *
+ * Eg.
+ * com.ibm.ws.eba.helloWorldService;version="[1.0.0, 1.0.0]" &
+ * com.ibm.ws.eba.helloWorldService;version="1.0.0"
+ * com.ibm.ws.eba.helloWorld;version="2";bundle-version="[2,30)"
+ * com.acme.foo;weirdAttr="one;two;three";weirdDir:="1;2;3"
+ * @param value the value to be split
+ * @param delimiter the delimiter string such as ',' etc.
+ * @return List<String> the components of the split String in a list
+ */
+ public static List<String> split(String value, String delimiter)
+ {
+
+ List<String> result = new ArrayList<String>();
+ if (value != null) {
+ String[] packages = value.split(delimiter);
+
+ for (int i = 0; i < packages.length; ) {
+ String tmp = packages[i++].trim();
+ // if there is a odd number of " in a string, we need to append
+ while (count(tmp, "\"") % 2 == 1) {
+ // check to see if we need to append the next package[i++]
+ tmp = tmp + delimiter + packages[i++].trim();
+ }
+
+ result.add(tmp);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * count the number of characters in a string
+ * @param parent The string to be searched
+ * @param subString The substring to be found
+ * @return the number of occurrence of the subString
+ */
+ private static int count(String parent, String subString) {
+
+ int count = 0 ;
+ int i = parent.indexOf(subString);
+ while (i > -1) {
+ if (parent.length() >= i+1)
+ parent = parent.substring(i+1);
+ count ++;
+ i = parent.indexOf(subString);
+ }
+ return count;
+ }
}
Propchange: incubator/aries/trunk/application/application-utils/src/main/java/org/apache/aries/application/utils/manifest/ManifestProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java (original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ParserServiceImpl.java Fri Jan 15 06:35:07 2010
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.aries.blueprint.container;
import java.io.IOException;
Modified: incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/codec/PackageData.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/codec/PackageData.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/codec/PackageData.java (original)
+++ incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/codec/PackageData.java Fri Jan 15 06:35:07 2010
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.aries.jmx.codec;
import java.util.HashMap;
Modified: incubator/aries/trunk/jpa/jpa-container/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/pom.xml?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/pom.xml (original)
+++ incubator/aries/trunk/jpa/jpa-container/pom.xml Fri Jan 15 06:35:07 2010
@@ -1,3 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>jpa</artifactId>
@@ -82,4 +101,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/util/FakeManagedPersistenceUnitFactory.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/util/FakeManagedPersistenceUnitFactory.java?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/util/FakeManagedPersistenceUnitFactory.java (original)
+++ incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/util/FakeManagedPersistenceUnitFactory.java Fri Jan 15 06:35:07 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.aries.jpa.container.util;
import org.apache.aries.jpa.container.ManagedPersistenceUnitInfoFactory;
Modified: incubator/aries/trunk/jpa/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/pom.xml?rev=899541&r1=899540&r2=899541&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/pom.xml (original)
+++ incubator/aries/trunk/jpa/pom.xml Fri Jan 15 06:35:07 2010
@@ -1,3 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>java5-parent</artifactId>
@@ -40,4 +59,4 @@
</dependency>
</dependencies>
</dependencyManagement>
-</project>
\ No newline at end of file
+</project>