Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 186947 Details for
Bug 334582
OSGi changes to the wiring API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to support new FragmentWirings type
bug334582-patch.txt (text/plain), 6.74 KB, created by
BJ Hargrave
on 2011-01-17 16:03:28 EST
(
hide
)
Description:
Patch to support new FragmentWirings type
Filename:
MIME Type:
Creator:
BJ Hargrave
Created:
2011-01-17 16:03:28 EST
Size:
6.74 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.osgi >Index: core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java,v >retrieving revision 1.45 >diff -u -r1.45 BundleFragment.java >--- core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java 10 Dec 2010 19:20:16 -0000 1.45 >+++ core/framework/org/eclipse/osgi/framework/internal/core/BundleFragment.java 17 Jan 2011 21:01:26 -0000 >@@ -22,7 +22,7 @@ > import org.eclipse.osgi.util.NLS; > import org.osgi.framework.*; > import org.osgi.framework.wiring.BundleWiring; >-import org.osgi.framework.wiring.BundleWirings; >+import org.osgi.framework.wiring.FragmentWirings; > > public class BundleFragment extends AbstractBundle { > >@@ -338,14 +338,14 @@ > > @SuppressWarnings("unchecked") > public <A> A adapt(Class<A> adapterType) { >- if (BundleWirings.class.equals(adapterType)) { >- return (A) new BundleWirings() { >+ if (FragmentWirings.class.equals(adapterType)) { >+ return (A) new FragmentWirings() { > public Bundle getBundle() { > return BundleFragment.this; > } > >- public List<BundleWiring> getWirings() { >- List<BundleWiring> wirings = new ArrayList<BundleWiring>(); >+ public Collection<BundleWiring> getWirings() { >+ Collection<BundleWiring> wirings = new ArrayList<BundleWiring>(); > BundleDescription current = getBundleDescription(); > BundleDescription[] removed = framework.adaptor.getState().getRemovalPending(); > >Index: osgi/src/org/osgi/framework/wiring/BundleWirings.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/wiring/BundleWirings.java,v >retrieving revision 1.3 >diff -u -r1.3 BundleWirings.java >--- osgi/src/org/osgi/framework/wiring/BundleWirings.java 4 Oct 2010 15:01:52 -0000 1.3 >+++ osgi/src/org/osgi/framework/wiring/BundleWirings.java 17 Jan 2011 21:01:26 -0000 >@@ -1,5 +1,5 @@ > /* >- * Copyright (c) OSGi Alliance (2010). All Rights Reserved. >+ * Copyright (c) OSGi Alliance (2010, 2011). All Rights Reserved. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. >@@ -29,8 +29,12 @@ > * > * <p> > * The in use bundle wirings for a bundle can be obtained by calling >- * {@link Bundle#adapt(Class) bundle.adapt}({@link BundleWirings}.class). >- * {@link BundleWirings#getWirings() getWirings()}. >+ * {@link Bundle#adapt(Class) bundle.adapt}({@link BundleWirings}.class) on the >+ * bundle. {@link BundleWirings#getWirings() getWirings()}. A fragment does not >+ * itself have bundle wirings. So calling {@link Bundle#adapt(Class) >+ * bundle.adapt}({@link BundleWirings}.class) on a fragment must return >+ * {@code null}. See {@link FragmentWirings} for the bundle wirings in which a >+ * fragment participates. > * > * @ThreadSafe > * @noimplement >@@ -42,20 +46,12 @@ > * {@link BundleReference#getBundle() referenced} bundle. > * > * <p> >- * If the referenced bundle is a non-fragment bundle, then the result is a >- * list of in use bundle wirings. The list is ordered in reverse >- * chronological order such that the first bundle wiring is the >+ * The result is a list of in use bundle wirings. The list is ordered in >+ * reverse chronological order such that the first bundle wiring is the > * {@link BundleWiring#isCurrent() current} bundle wiring and last wiring is > * the oldest in use bundle wiring. > * > * <p> >- * If the referenced bundle is a fragment bundle, then the result is a list >- * of in use bundle wirings to which the referenced fragment bundle is >- * attached. The ordering of the list is unspecified. If the fragment bundle >- * is not attached to any bundle wiring, then the returned list will be >- * empty. >- * >- * <p> > * The list must only contain in use bundle wirings. Generally the list will > * have at least one bundle wiring for the bundle: the current bundle > * wiring. However, for an uninstalled bundle with no in use bundle wirings >Index: osgi/src/org/osgi/framework/wiring/FragmentWirings.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/FragmentWirings.java >diff -N osgi/src/org/osgi/framework/wiring/FragmentWirings.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/FragmentWirings.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (c) OSGi Alliance (2011). All Rights Reserved. >+ * >+ * Licensed 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.osgi.framework.wiring; >+ >+import java.util.Collection; >+ >+import org.osgi.framework.Bundle; >+import org.osgi.framework.BundleReference; >+ >+/** >+ * The {@link BundleWiring#isInUse() in use} bundle wirings for a fragment. Each >+ * time a bundle is resolved, a new bundle wiring of the bundle is created. A >+ * bundle wiring consists of a bundle and its attached fragments and represents >+ * the dependencies with other bundle wirings. >+ * >+ * <p> >+ * The in use bundle wirings for a fragment can be obtained by calling >+ * {@link Bundle#adapt(Class) bundle.adapt}({@link FragmentWirings}.class). >+ * {@link FragmentWirings#getWirings() getWirings()} on the fragment's >+ * {@code Bundle} object. Calling {@link Bundle#adapt(Class) bundle.adapt}( >+ * {@link FragmentWirings} .class) on a non-fragment bundle must return >+ * {@code null}. >+ * >+ * @ThreadSafe >+ * @noimplement >+ * @version $Id$ >+ */ >+public interface FragmentWirings extends BundleReference { >+ /** >+ * Return the {@link BundleWiring#isInUse() in use} wirings for the >+ * {@link BundleReference#getBundle() referenced} fragment. >+ * >+ * <p> >+ * The result is a list of in use bundle wirings to which the referenced >+ * fragment is attached. If the fragment is not attached to any bundle >+ * wiring, then the returned collection will be empty. >+ * >+ * <p> >+ * The collection must only contain in use bundle wirings. >+ * >+ * @return A collection containing a snapshot of the {@link BundleWiring}s >+ * for the referenced fragment. >+ */ >+ Collection<BundleWiring> getWirings(); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 334582
:
186947
|
187534