You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/12/20 22:56:07 UTC
svn commit: r489207 - in
/incubator/felix/trunk/framework/src/main/java/org/apache/felix: framework/
framework/util/manifestparser/ moduleloader/
Author: rickhall
Date: Wed Dec 20 13:56:06 2006
New Revision: 489207
URL: http://svn.apache.org/viewvc?view=rev&rev=489207
Log:
Some initial ground work for creating a generic resolver as the first
step for supporting require-bundle (FELIX-28).
Added:
incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java (with props)
incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java (with props)
incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java (with props)
incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java (with props)
Modified:
incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?view=diff&rev=489207&r1=489206&r2=489207
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Wed Dec 20 13:56:06 2006
@@ -456,6 +456,8 @@
}
catch (Exception ex)
{
+// TODO: RB - Should this be system bundle, since bundle could be null?
+// fireFrameworkEvent(FrameworkEvent.ERROR, systembundle, ex);
fireFrameworkEvent(FrameworkEvent.ERROR, bundle, ex);
try
{
Added: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java?view=auto&rev=489207
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java (added)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java Wed Dec 20 13:56:06 2006
@@ -0,0 +1,50 @@
+/*
+ * 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.felix.framework.util.manifestparser;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.felix.moduleloader.ICapability;
+
+public class Capability implements ICapability
+{
+ private String m_namespace = null;
+ private Map m_propMap = null;
+
+ public Capability(String namespace, Map propMap)
+ {
+ m_namespace = namespace;
+ m_propMap = Collections.unmodifiableMap(propMap);
+ }
+
+ public String getNamespace()
+ {
+ return m_namespace;
+ }
+
+ public Map getProperties()
+ {
+ return m_propMap;
+ }
+
+ public String[] getUses()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Propchange: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Capability.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java?view=auto&rev=489207
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java (added)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java Wed Dec 20 13:56:06 2006
@@ -0,0 +1,73 @@
+/*
+ * 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.felix.framework.util.manifestparser;
+
+import org.apache.felix.framework.FilterImpl;
+import org.apache.felix.framework.util.MapToDictionary;
+import org.apache.felix.moduleloader.ICapability;
+import org.apache.felix.moduleloader.IRequirement;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+
+public class Requirement implements IRequirement
+{
+ private String m_namespace = null;
+ private Filter m_filter = null;
+
+ public Requirement(String namespace, String filterStr) throws InvalidSyntaxException
+ {
+ m_namespace = namespace;
+ m_filter = new FilterImpl(filterStr);
+ }
+
+ public String getNamespace()
+ {
+ return m_namespace;
+ }
+
+ public Filter getFilter()
+ {
+ return m_filter;
+ }
+
+ public boolean isMultiple()
+ {
+ return false;
+ }
+
+ public boolean isOptional()
+ {
+ return false;
+ }
+
+ public String getComment()
+ {
+ return null;
+ }
+
+ public boolean isSatisfied(ICapability capability)
+ {
+ return m_filter.match(new MapToDictionary(capability.getProperties()));
+ }
+
+ public String toString()
+ {
+ return m_filter.toString();
+ }
+}
\ No newline at end of file
Propchange: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/Requirement.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java?view=auto&rev=489207
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java (added)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java Wed Dec 20 13:56:06 2006
@@ -0,0 +1,34 @@
+/*
+ * 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.felix.moduleloader;
+
+import java.util.Map;
+
+public interface ICapability
+{
+ public static final String MODULE_NAMESPACE = "module";
+ public static final String PACKAGE_NAMESPACE = "package";
+
+ public static final String PACKAGE_PROPERTY = "package";
+ public static final String VERSION_PROPERTY = "version";
+
+ String getNamespace();
+ Map getProperties();
+ String[] getUses();
+}
\ No newline at end of file
Propchange: incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/ICapability.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java?view=auto&rev=489207
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java (added)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java Wed Dec 20 13:56:06 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.felix.moduleloader;
+
+import org.osgi.framework.Filter;
+
+public interface IRequirement
+{
+ String getNamespace();
+ Filter getFilter();
+ boolean isMultiple();
+ boolean isOptional();
+ String getComment();
+ boolean isSatisfied(ICapability capability);
+}
\ No newline at end of file
Propchange: incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IRequirement.java
------------------------------------------------------------------------------
svn:eol-style = native