Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2010-05-17 14:15:43 -0400
committercvs2svn2010-05-17 14:15:43 -0400
commit095cc2f0552d415e09b4105e68369da4d8344bc7 (patch)
treea12f5e0610ed8f6f0b6b390661fc2805a0588ebb
parent3ab1919987640f655f8b369bdd91718227dd1cbc (diff)
downloadrt.equinox.framework-095cc2f0552d415e09b4105e68369da4d8344bc7.tar.gz
rt.equinox.framework-095cc2f0552d415e09b4105e68369da4d8344bc7.tar.xz
rt.equinox.framework-095cc2f0552d415e09b4105e68369da4d8344bc7.zip
This commit was manufactured by cvs2svn to create branch 'R3_6_maintenance'.
Sprout from master 2010-05-17 18:15:39 UTC Thomas Watson <twatson> ' Bug 312917 - IllegalStateException on shutdown' Delete: bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventDispatcher.java bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventListeners.java bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/ListenerQueue.java bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/package.html releng/org.eclipse.equinox.launcher.releng/.project releng/org.eclipse.equinox.launcher.releng/build.xml releng/org.eclipse.equinox.launcher.releng/remote.sh
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java439
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventDispatcher.java49
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventListeners.java89
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java416
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/ListenerQueue.java152
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/package.html17
-rw-r--r--releng/org.eclipse.equinox.launcher.releng/.project11
-rw-r--r--releng/org.eclipse.equinox.launcher.releng/build.xml257
-rw-r--r--releng/org.eclipse.equinox.launcher.releng/remote.sh48
9 files changed, 0 insertions, 1478 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java
deleted file mode 100644
index 6345a3fce..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.framework.eventmgr;
-
-import java.util.*;
-
-/**
- * A copy-on-write identity map. Write operations result in copying the underlying data so that
- * simultaneous read operations are not affected.
- * This allows for safe, unsynchronized traversal.
- *
- * <p>
- * Note: This class uses identity for key and value comparison, not equals.
- *
- * @since 3.5
- */
-public class CopyOnWriteIdentityMap implements Map {
- /**
- * The empty array singleton instance.
- */
- private static final Entry[] emptyArray = new Entry[0];
-
- /**
- * The array of entries. This field is volatile so it can be
- * accessed from unsynchronized reader methods.
- */
- private volatile Entry[] entries;
-
- /**
- * Creates an empty map.
- *
- */
- public CopyOnWriteIdentityMap() {
- entries = emptyArray;
- }
-
- /**
- * Copy constructor.
- *
- * @param source The CopyOnWriteMap to copy.
- */
- public CopyOnWriteIdentityMap(CopyOnWriteIdentityMap source) {
- this.entries = source.entries();
- }
-
- /* These methods modify the map and are synchronized. */
-
- /**
- * Add a key, value pair to the map.
- * If the key object is already in the map, then its value is replaced with the new value.
- * Keys are compared using identity.
- *
- * @param key The key object to be added to the list.
- * @param value The value object to be associated with the key.
- * This may be null.
- * @return <code>null</code> if the specified key was newly added to the map.
- * Otherwise the previous value of the key.
- * @throws IllegalArgumentException If key is null.
- */
- public synchronized Object put(Object key, Object value) {
- if (key == null) {
- throw new IllegalArgumentException();
- }
-
- int size = entries.length;
- for (int i = 0; i < size; i++) {
- if (entries[i].key == key) {
- Object v = entries[i].value;
- if (v == value) {
- return v;
- }
- Entry[] newEntries = new Entry[size];
- System.arraycopy(entries, 0, newEntries, 0, size);
- newEntries[i] = new Entry(key, value);
- entries = newEntries;
- return v;
- }
- }
-
- Entry[] newEntries = new Entry[size + 1];
- if (size > 0) {
- System.arraycopy(entries, 0, newEntries, 0, size);
- }
- newEntries[size] = new Entry(key, value);
- entries = newEntries;
- return null;
- }
-
- /**
- * Add all the entries from the specified map to this map.
- *
- * @param source The map whose entries are to be added to this map.
- */
- public void putAll(Map source) {
- int sourceSize = source.size();
- if (sourceSize == 0) {
- return;
- }
- if (source instanceof CopyOnWriteIdentityMap) {
- putAll(((CopyOnWriteIdentityMap) source).entries());
- return;
- }
-
- Entry[] toCopy = new Entry[sourceSize];
- Iterator iter = source.entrySet().iterator();
- for (int i = 0; i < sourceSize; i++) {
- Map.Entry mapEntry = (Map.Entry) iter.next();
- toCopy[i] = new Entry(mapEntry.getKey(), mapEntry.getValue());
- }
- putAll(toCopy);
- }
-
- /**
- * Add all the keys from the specified array to this map with the value
- * <code>null</code>.
- *
- * @param keys The array of keys to be added to this map.
- */
- public void putAll(Object[] keys) {
- int sourceSize = keys.length;
- if (sourceSize == 0) {
- return;
- }
- Entry[] toCopy = new Entry[sourceSize];
- for (int i = 0; i < sourceSize; i++) {
- toCopy[i] = new Entry(keys[i], null);
- }
- putAll(toCopy);
- }
-
- /**
- * Add all the entries to this map.
- *
- * @param toCopy Array of entries to add to this map.
- */
- private synchronized void putAll(Entry[] toCopy) {
- int sourceSize = toCopy.length;
- int size = entries.length;
- Entry[] newEntries = new Entry[size + sourceSize];
- System.arraycopy(entries, 0, newEntries, 0, size);
- copy: for (int n = 0; n < sourceSize; n++) {
- Entry copy = toCopy[n];
- for (int i = 0; i < size; i++) {
- if (newEntries[i].key == copy.key) {
- newEntries[i] = copy;
- continue copy;
- }
- }
- newEntries[size] = copy;
- size++;
- }
- if (size == newEntries.length) {
- entries = newEntries;
- return;
- }
- Entry[] e = new Entry[size];
- System.arraycopy(newEntries, 0, e, 0, size);
- entries = e;
- }
-
- /**
- * Remove a key from the map and returns the value associated with the key.
- * Key objects are compared using identity.
- *
- * @param key The key object to be removed from the map.
- * @return <code>null</code> if the key was not in the list.
- * Otherwise, the value associated with the key.
- * @throws IllegalArgumentException If key is null.
- */
- public synchronized Object remove(Object key) {
- if (key == null) {
- throw new IllegalArgumentException();
- }
-
- int size = entries.length;
- for (int i = 0; i < size; i++) {
- if (entries[i].key == key) {
- Object v = entries[i].value;
- if (size == 1) {
- entries = emptyArray;
- return v;
- }
- Entry[] newEntries = new Entry[size - 1];
- if (i > 0) {
- System.arraycopy(entries, 0, newEntries, 0, i);
- }
- int next = size - 1 - i;
- if (next > 0) {
- System.arraycopy(entries, i + 1, newEntries, i, next);
- }
- entries = newEntries;
- return v;
- }
- }
- return null;
- }
-
- /**
- * Remove all entries from the map.
- *
- */
- public synchronized void clear() {
- entries = emptyArray;
- }
-
- /* These methods only read the map and are not synchronized. */
-
- /**
- * Accessor for methods which only read the entries.
- * @return The array of entries. Callers to this method MUST NOT
- * modify the returned array.
- */
- private Entry[] entries() {
- return entries;
- }
-
- /**
- * Is the map empty?
- *
- * @return <code>true</code> if the list is empty.
- */
- public boolean isEmpty() {
- return size() == 0;
- }
-
- /**
- * Return the number of entries in the map.
- *
- * @return The number of entries in the map.
- */
- public int size() {
- return entries().length;
- }
-
- /**
- * Return the value object for the specified key.
- * Keys are compared using identity.
- *
- * @param key The key object.
- * @return The value object for the specified key.
- * @throws IllegalArgumentException If key is null.
- */
- public Object get(Object key) {
- if (key == null) {
- throw new IllegalArgumentException();
- }
-
- Entry[] e = entries();
- for (int i = 0; i < e.length; i++) {
- if (e[i].key == key) {
- return e[i].value;
- }
- }
- return null;
- }
-
- /**
- * Check if the map contains the specified key.
- * Keys are compared using identity.
- *
- * @param key The key object.
- * @return <code>true</code> if the specified key is in the map.
- * @throws IllegalArgumentException If key is null.
- */
- public boolean containsKey(Object key) {
- if (key == null) {
- throw new IllegalArgumentException();
- }
-
- Entry[] e = entries();
- for (int i = 0; i < e.length; i++) {
- if (e[i].key == key) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Check if the map contains the specified value.
- * Values are compared using identity.
- *
- * @param value The value object.
- * @return <code>true</code> if the specified value is in the map.
- */
- public boolean containsValue(Object value) {
- Entry[] e = entries();
- for (int i = 0; i < e.length; i++) {
- if (e[i].value == value) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns a snapshot of the entries in this map.
- * The returned set will NOT be changed by future changes to this map.
- *
- * @return A Set of Map.Entry for each entry in this map.
- * The set and the entries returned by the set cannot be modified.
- */
- public Set entrySet() {
- return new EntrySet(entries(), EntrySet.ENTRY);
- }
-
- /**
- * Returns a snapshot of the keys in this map.
- * The returned set will NOT be changed by future changes to this map.
- *
- * @return A Set of the key objects in this map
- * The set cannot be modified.
- */
- public Set keySet() {
- return new EntrySet(entries(), EntrySet.KEY);
- }
-
- /**
- * Returns a snapshot of the values in this map.
- * The returned collection will NOT be changed by future changes to this map.
- *
- * @return A Collection of the value objects in this map.
- * The collection cannot be modified.
- */
- public Collection values() {
- return new EntrySet(entries(), EntrySet.VALUE);
- }
-
- /**
- * This class represents the entry in this Map.
- * Entry is immutable.
- */
- private static class Entry implements Map.Entry {
- /**
- * Key object.
- */
- final Object key;
-
- /**
- * Value object.
- */
- final Object value;
-
- /**
- * Constructor for map entry.
- * @param key Key object in entry. Used for uniqueness.
- * @param value Value object stored with key object.
- */
- Entry(final Object key, final Object value) {
- this.key = key;
- this.value = value;
- }
-
- public Object getKey() {
- return key;
- }
-
- public Object getValue() {
- return value;
- }
-
- public Object setValue(Object value) {
- throw new UnsupportedOperationException(); // entries cannot be modified.
- }
- }
-
- /**
- * Set class used for entry and key sets and values collections.
- *
- * This class is immutable.
- */
- private static class EntrySet extends AbstractSet {
- private final Entry[] entries;
- private final int returnType;
- final static int ENTRY = 1;
- final static int KEY = 2;
- final static int VALUE = 3;
-
- EntrySet(Entry[] entries, int returnType) {
- this.entries = entries;
- this.returnType = returnType;
- }
-
- public Iterator iterator() {
- return new EntryIterator(entries, returnType);
- }
-
- public int size() {
- return entries.length;
- }
- }
-
- /**
- * Iterator class used for entry and key sets and values collections.
- *
- */
- private static class EntryIterator implements Iterator {
- private final Entry[] entries;
- private final int returnType;
- private int cursor = 0;
-
- EntryIterator(Entry[] entries, int returnType) {
- this.entries = entries;
- this.returnType = returnType;
- }
-
- public boolean hasNext() {
- return cursor < entries.length;
- }
-
- public Object next() {
- if (cursor == entries.length) {
- throw new NoSuchElementException();
- }
- switch (returnType) {
- case EntrySet.ENTRY :
- return entries[cursor++];
- case EntrySet.KEY :
- return entries[cursor++].key;
- case EntrySet.VALUE :
- return entries[cursor++].value;
- }
- throw new InternalError();
- }
-
- public void remove() {
- throw new UnsupportedOperationException(); // the collection cannot be modified.
- }
- }
-}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventDispatcher.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventDispatcher.java
deleted file mode 100644
index 3e6f3cb18..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventDispatcher.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.framework.eventmgr;
-
-/**
- * The EventDispatcher interface contains the method that is called by the
- * Event Manager to complete the event delivery to the event listener.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface EventDispatcher {
- /**
- * This method is called once for each listener.
- * This method must cast the event listener object to the appropriate listener
- * class for the event type and call the appropriate listener method.
- *
- * <p>The method should properly log/handle any exceptions thrown by the called
- * listener. The EventManager will ignore any Throwable thrown by this method
- * in order to continue delivery of the event to the next listener.
- *
- * @param eventListener This is the key in the Map.Entry for the listener.
- * The implementation of this method must cast it to the appropriate listener
- * class for the event to be delivered and the appropriate listener method
- * must then be called.
- * @param listenerObject This is the value in the Map.Entry for the listener.
- * @param eventAction This value was passed to the ListenerQueue object via one of its
- * dispatchEvent* method calls. It can provide information (such
- * as which listener method to call) so that the EventDispatcher
- * can complete the delivery of the event to the listener.
- * @param eventObject This object was passed to the ListenerQueue object via one of its
- * dispatchEvent* method calls. This object was created by the event source and
- * is passed to this method. It should contain all the necessary information (such
- * as what event object to pass) so that this method
- * can complete the delivery of the event to the listener.
- * This is typically the actual event object.
- */
- public void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, Object eventObject);
-}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventListeners.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventListeners.java
deleted file mode 100644
index fee66aeb5..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventListeners.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.framework.eventmgr;
-
-import java.util.Set;
-
-/**
- * This class manages a list of listeners.
- *
- * Listeners may be added or removed as necessary.
- *
- * This class uses identity for comparison, not equals.
- *
- * @since 3.1
- * @deprecated As of 3.5. Replaced by CopyOnWriteIdentityMap.
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class EventListeners {
- private final CopyOnWriteIdentityMap list = new CopyOnWriteIdentityMap();
-
- /**
- * Creates an empty listener list.
- *
- */
- public EventListeners() {
- super();
- }
-
- /**
- * Creates an empty listener list.
- *
- * @param capacity This argument is ignored.
- */
- public EventListeners(int capacity) {
- this();
- }
-
- /**
- * Add a listener to the list.
- * If a listener object is already in the list, then it is replaced.
- * This method calls the put method.
- *
- * @param listener This is the listener object to be added to the list.
- * @param listenerObject This is an optional listener-specific object.
- * This object will be passed to the EventDispatcher along with the listener
- * when the listener is to be called. This may be null
- * @throws IllegalArgumentException If listener is null.
- */
- public void addListener(Object listener, Object listenerObject) {
- list.put(listener, listenerObject);
- }
-
- /**
- * Remove a listener from the list.
- * This method calls the remove method.
- *
- * @param listener This is the listener object to be removed from the list.
- * @throws IllegalArgumentException If listener is null.
- */
- public void removeListener(Object listener) {
- list.remove(listener);
- }
-
- /**
- * Remove all listeners from the list.
- *
- * This method calls the clear method.
- */
- public void removeAllListeners() {
- list.clear();
- }
-
- /**
- * Get the entry Set from the internal CopyOnWriteIdentityMap.
- * @return The entry Set.
- */
- Set entrySet() {
- return list.entrySet();
- }
-}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java
deleted file mode 100644
index 2dc7188c7..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.framework.eventmgr;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.*;
-
-/**
- * This class is the central class for the Event Manager. Each
- * program that wishes to use the Event Manager should construct
- * an EventManager object and use that object to construct
- * ListenerQueue for dispatching events. CopyOnWriteIdentityMap objects
- * must be used to manage listener lists.
- *
- * <p>This example uses the fictitious SomeEvent class and shows how to use this package
- * to deliver a SomeEvent to a set of SomeEventListeners.
- * <pre>
- *
- * // Create an EventManager with a name for an asynchronous event dispatch thread
- * EventManager eventManager = new EventManager("SomeEvent Async Event Dispatcher Thread");
- * // Create a CopyOnWriteIdentityMap to hold the list of SomeEventListeners
- * Map eventListeners = new CopyOnWriteIdentityMap();
- *
- * // Add a SomeEventListener to the listener list
- * eventListeners.put(someEventListener, null);
- *
- * // Asynchronously deliver a SomeEvent to registered SomeEventListeners
- * // Create the listener queue for this event delivery
- * ListenerQueue listenerQueue = new ListenerQueue(eventManager);
- * // Add the listeners to the queue and associate them with the event dispatcher
- * listenerQueue.queueListeners(eventListeners.entrySet(), new EventDispatcher() {
- * public void dispatchEvent(Object eventListener, Object listenerObject,
- * int eventAction, Object eventObject) {
- * try {
- * (SomeEventListener)eventListener.someEventOccured((SomeEvent)eventObject);
- * } catch (Throwable t) {
- * // properly log/handle any Throwable thrown by the listener
- * }
- * }
- * });
- * // Deliver the event to the listeners.
- * listenerQueue.dispatchEventAsynchronous(0, new SomeEvent());
- *
- * // Remove the listener from the listener list
- * eventListeners.remove(someEventListener);
- *
- * // Close EventManager to clean when done to terminate async event dispatch thread.
- * // Note that closing the event manager while asynchronously delivering events
- * // may cause some events to not be delivered before the async event dispatch
- * // thread terminates
- * eventManager.close();
- * </pre>
- *
- * <p>At first glance, this package may seem more complicated than necessary
- * but it has support for some important features. The listener list supports
- * companion objects for each listener object. This is used by the OSGi framework
- * to create wrapper objects for a listener which are passed to the event dispatcher.
- * The ListenerQueue class is used to build a snap shot of the listeners prior to beginning
- * event dispatch.
- *
- * The OSGi framework uses a 2 level listener list for each listener type (4 types).
- * Level one is managed per framework instance and contains the list of BundleContexts which have
- * registered a listener. Level 2 is managed per BundleContext for the listeners in that
- * context. This allows all the listeners of a bundle to be easily and atomically removed from
- * the level one list. To use a "flat" list for all bundles would require the list to know which
- * bundle registered a listener object so that the list could be traversed when stopping a bundle
- * to remove all the bundle's listeners.
- *
- * When an event is fired, a snapshot list (ListenerQueue) must be made of the current listeners before delivery
- * is attempted. The snapshot list is necessary to allow the listener list to be modified while the
- * event is being delivered to the snapshot list. The memory cost of the snapshot list is
- * low since the ListenerQueue object uses the copy-on-write semantics
- * of the CopyOnWriteIdentityMap. This guarantees the snapshot list is never modified once created.
- *
- * The OSGi framework also uses a 2 level dispatch technique (EventDispatcher).
- * Level one dispatch is used by the framework to add the level 2 listener list of each
- * BundleContext to the snapshot in preparation for delivery of the event.
- * Level 2 dispatch is used as the final event deliverer and must cast the listener
- * and event objects to the proper type before calling the listener. Level 2 dispatch
- * will cancel delivery of an event
- * to a bundle that has stopped between the time the snapshot was created and the
- * attempt was made to deliver the event.
- *
- * <p> The highly dynamic nature of the OSGi framework had necessitated these features for
- * proper and efficient event delivery.
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-
-public class EventManager {
- static final boolean DEBUG = false;
-
- /**
- * EventThread for asynchronous dispatch of events.
- * Access to this field must be protected by a synchronized region.
- */
- private EventThread thread;
-
- /**
- * Once closed, an attempt to create a new EventThread will result in an
- * IllegalStateException.
- */
- private boolean closed;
-
- /**
- * Thread name used for asynchronous event delivery
- */
- protected final String threadName;
-
- /**
- * The thread group used for asynchronous event delivery
- */
- protected final ThreadGroup threadGroup;
-
- /**
- * EventManager constructor. An EventManager object is responsible for
- * the delivery of events to listeners via an EventDispatcher.
- *
- */
- public EventManager() {
- this(null, null);
- }
-
- /**
- * EventManager constructor. An EventManager object is responsible for
- * the delivery of events to listeners via an EventDispatcher.
- *
- * @param threadName The name to give the event thread associated with
- * this EventManager. A <code>null</code> value is allowed.
- */
- public EventManager(String threadName) {
- this(threadName, null);
- }
-
- /**
- * EventManager constructor. An EventManager object is responsible for
- * the delivery of events to listeners via an EventDispatcher.
- *
- * @param threadName The name to give the event thread associated with
- * this EventManager. A <code>null</code> value is allowed.
- * @param threadGroup The thread group to use for the asynchronous event
- * thread associated with this EventManager. A <code>null</code> value is allowed.
- * @since 3.4
- */
- public EventManager(String threadName, ThreadGroup threadGroup) {
- thread = null;
- closed = false;
- this.threadName = threadName;
- this.threadGroup = threadGroup;
- }
-
- /**
- * This method can be called to release any resources associated with this
- * EventManager.
- * <p>
- * Closing this EventManager while it is asynchronously delivering events
- * may cause some events to not be delivered before the async event dispatch
- * thread terminates.
- */
- public synchronized void close() {
- if (closed) {
- return;
- }
- if (thread != null) {
- thread.close();
- thread = null;
- }
- closed = true;
- }
-
- /**
- * Returns the EventThread to use for dispatching events asynchronously for
- * this EventManager.
- *
- * @return EventThread to use for dispatching events asynchronously for
- * this EventManager.
- */
- synchronized EventThread getEventThread() {
- if (closed) {
- throw new IllegalStateException();
- }
- if (thread == null) {
- /* if there is no thread, then create a new one */
- thread = (EventThread) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- EventThread t = new EventThread(threadGroup, threadName);
- return t;
- }
- });
- /* start the new thread */
- thread.start();
- }
- return thread;
- }
-
- /**
- * This method calls the EventDispatcher object to complete the dispatch of
- * the event. If there are more elements in the list, call dispatchEvent
- * on the next item on the list.
- * This method is package private.
- *
- * @param listeners A Set of entries from a CopyOnWriteIdentityMap map.
- * @param dispatcher Call back object which is called to complete the delivery of
- * the event.
- * @param eventAction This value was passed by the event source and
- * is passed to this method. This is passed on to the call back object.
- * @param eventObject This object was created by the event source and
- * is passed to this method. This is passed on to the call back object.
- */
- static void dispatchEvent(Set/*<Map.Entry<Object,Object>>*/listeners, EventDispatcher dispatcher, int eventAction, Object eventObject) {
- for (Iterator iter = listeners.iterator(); iter.hasNext();) { /* iterate over the list of listeners */
- Map.Entry listener = (Map.Entry) iter.next();
- Object eventListener = listener.getKey();
- Object listenerObject = listener.getValue();
- try {
- /* Call the EventDispatcher to complete the delivery of the event. */
- dispatcher.dispatchEvent(eventListener, listenerObject, eventAction, eventObject);
- } catch (Throwable t) {
- /* Consume and ignore any exceptions thrown by the listener */
- if (DEBUG) {
- System.out.println("Exception in " + listener.getKey()); //$NON-NLS-1$
- t.printStackTrace();
- }
- }
- }
- }
-
- /**
- * This package private class is used for asynchronously dispatching events.
- */
-
- static class EventThread extends Thread {
- private static int nextThreadNumber;
-
- /**
- * Queued is a nested top-level (non-member) class. This class
- * represents the items which are placed on the asynch dispatch queue.
- * This class is private.
- */
- private static class Queued {
- /** listener list for this event */
- final Set/*<Map.Entry<Object,Object>>*/listeners;
- /** dispatcher of this event */
- final EventDispatcher dispatcher;
- /** action for this event */
- final int action;
- /** object for this event */
- final Object object;
- /** next item in event queue */
- Queued next;
-
- /**
- * Constructor for event queue item
- *
- * @param l Listener list for this event
- * @param d Dispatcher for this event
- * @param a Action for this event
- * @param o Object for this event
- */
- Queued(Set/*<Map.Entry<Object,Object>>*/l, EventDispatcher d, int a, Object o) {
- listeners = l;
- dispatcher = d;
- action = a;
- object = o;
- next = null;
- }
- }
-
- /** item at the head of the event queue */
- private Queued head;
- /** item at the tail of the event queue */
- private Queued tail;
- /** if false the thread must terminate */
- private volatile boolean running;
-
- /**
- * Constructor for the event thread.
- * @param threadName Name of the EventThread
- */
- EventThread(ThreadGroup threadGroup, String threadName) {
- super(threadGroup, threadName == null ? getNextName() : threadName);
- running = true;
- head = null;
- tail = null;
-
- setDaemon(true); /* Mark thread as daemon thread */
- }
-
- private static synchronized String getNextName() {
- return "EventManagerThread-" + nextThreadNumber++; //$NON-NLS-1$
- }
-
- /**
- * Constructor for the event thread.
- * @param threadName Name of the EventThread
- */
- EventThread(String threadName) {
- this(null, threadName);
- }
-
- /**
- * Constructor for the event thread.
- */
- EventThread() {
- this(null, null);
- }
-
- /**
- * Stop thread.
- */
- void close() {
- running = false;
- interrupt();
- }
-
- /**
- * This method pulls events from
- * the queue and dispatches them.
- */
- public void run() {
- try {
- while (true) {
- Queued item = getNextEvent();
- if (item == null) {
- return;
- }
- EventManager.dispatchEvent(item.listeners, item.dispatcher, item.action, item.object);
- // Bug 299589: since the call to getNextEvent() will eventually block for a long time, we need to make sure that the 'item'
- // variable is cleared of the previous value before the call to getNextEvent(). See VM SPec 2.5.7 for why the compiler
- // will not automatically clear this variable for each loop iteration.
- item = null;
- }
- } catch (RuntimeException e) {
- if (EventManager.DEBUG) {
- e.printStackTrace();
- }
- throw e;
- } catch (Error e) {
- if (EventManager.DEBUG) {
- e.printStackTrace();
- }
- throw e;
- }
- }
-
- /**
- * This methods takes the input parameters and creates a Queued
- * object and queues it.
- * The thread is notified.
- *
- * @param l Listener list for this event
- * @param d Dispatcher for this event
- * @param a Action for this event
- * @param o Object for this event
- */
- synchronized void postEvent(Set/*<Map.Entry<Object,Object>>*/l, EventDispatcher d, int a, Object o) {
- if (!isAlive()) { /* If the thread is not alive, throw an exception */
- throw new IllegalStateException();
- }
-
- Queued item = new Queued(l, d, a, o);
-
- if (head == null) /* if the queue was empty */
- {
- head = item;
- tail = item;
- } else /* else add to end of queue */
- {
- tail.next = item;
- tail = item;
- }
-
- notify();
- }
-
- /**
- * This method is called by the thread to remove
- * items from the queue so that they can be dispatched to their listeners.
- * If the queue is empty, the thread waits.
- *
- * @return The Queued removed from the top of the queue or null
- * if the thread has been requested to stop.
- */
- private synchronized Queued getNextEvent() {
- while (running && (head == null)) {
- try {
- wait();
- } catch (InterruptedException e) {
- // If interrupted, we will loop back up and check running
- }
- }
-
- if (!running) { /* if we are stopping */
- return null;
- }
-
- Queued item = head;
- head = item.next;
- if (head == null) {
- tail = null;
- }
-
- return item;
- }
- }
-}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/ListenerQueue.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/ListenerQueue.java
deleted file mode 100644
index 0f63ecc18..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/ListenerQueue.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.framework.eventmgr;
-
-import java.util.*;
-import org.eclipse.osgi.framework.eventmgr.EventManager.EventThread;
-
-/**
- * The ListenerQueue is used to snapshot the list of listeners at the time the event
- * is fired. The snapshot list is then used to dispatch
- * events to those listeners. A ListenerQueue object is associated with a
- * specific EventManager object. ListenerQueue objects constructed with the same
- * EventManager object will get in-order delivery of events when
- * using asynchronous delivery. No delivery order is guaranteed for synchronous
- * delivery to avoid any potential deadly embraces.
- *
- * <p>ListenerQueue objects are created as necessary to build a list of listeners
- * that should receive a specific event or events. Once the list is created, the event
- * can then be synchronously or asynchronously delivered to the list of
- * listeners. After the event has been dispatched for delivery, the
- * ListenerQueue object should be discarded as it is likely the list of listeners is stale.
- * A new ListenerQueue object should be created when it is time to deliver
- * another event. The Sets used to build the list of listeners must not change after being
- * added to the list.
- * @since 3.1
- */
-public class ListenerQueue {
- /**
- * EventManager with which this queue is associated.
- */
- protected final EventManager manager;
- /**
- * A list of listener lists.
- */
- private final Map /*<Set<Map.Entry<Object,Object>>,EventDispatcher>*/queue;
-
- /**
- * Once the listener queue has been used to dispatch an event,
- * you cannot add modify the queue.
- * Access to this field must be protected by a synchronized region.
- */
- private boolean readOnly;
-
- /**
- * ListenerQueue constructor. This method creates an empty snapshot list.
- *
- * @param manager The EventManager this queue is associated with.
- * @throws IllegalArgumentException If manager is null.
- */
- public ListenerQueue(EventManager manager) {
- if (manager == null) {
- throw new IllegalArgumentException();
- }
-
- this.manager = manager;
- queue = new CopyOnWriteIdentityMap();
- readOnly = false;
- }
-
- /**
- * Add a listener list to the snapshot list. This method can be called multiple times, prior to
- * calling one of the dispatchEvent methods, to build the set of listeners for the
- * delivery of a specific event. The current list of listeners in the specified EventListeners
- * object is added to the snapshot list.
- *
- * @param listeners An EventListeners object to add to the queue. The current listeners
- * in the EventListeners object will be called when an event is dispatched.
- * @param dispatcher An EventDispatcher object to use when dispatching an event
- * to the listeners on the specified EventListeners.
- * @throws IllegalStateException If called after one of the dispatch methods has been called.
- * @deprecated As of 3.5. Replaced by {@link #queueListeners(Set, EventDispatcher)}.
- */
- public void queueListeners(EventListeners listeners, EventDispatcher dispatcher) {
- queueListeners(listeners.entrySet(), dispatcher);
- }
-
- /**
- * Add a set of listeners to the snapshot list. This method can be called multiple times, prior to
- * calling one of the dispatchEvent methods, to build the list of listeners for the
- * delivery of a specific event. The specified listeners
- * are added to the snapshot list.
- *
- * @param listeners A Set of Map.Entries to add to the queue. This is typically the entrySet
- * from a CopyOnWriteIdentityMap object. This set must not change after being added to this
- * snapshot list.
- * @param dispatcher An EventDispatcher object to use when dispatching an event
- * to the specified listeners.
- * @throws IllegalStateException If called after one of the dispatch methods has been called.
- * @since 3.5
- */
- public synchronized void queueListeners(Set/*<Map.Entry<Object,Object>>*/listeners, EventDispatcher dispatcher) {
- if (readOnly) {
- throw new IllegalStateException();
- }
-
- if (listeners.size() != 0) {
- queue.put(listeners, dispatcher); // enqueue the list and its dispatcher
- }
- }
-
- /**
- * Asynchronously dispatch an event to the snapshot list. An event dispatch thread
- * maintained by the associated EventManager is used to deliver the events.
- * This method may return immediately to the caller.
- *
- * @param eventAction This value is passed to the EventDispatcher.
- * @param eventObject This object is passed to the EventDispatcher.
- */
- public void dispatchEventAsynchronous(int eventAction, Object eventObject) {
- synchronized (this) {
- readOnly = true;
- }
- EventThread eventThread = manager.getEventThread();
- synchronized (eventThread) { /* synchronize on the EventThread to ensure no interleaving of posting to the event thread */
- for (Iterator iter = queue.entrySet().iterator(); iter.hasNext();) { /* iterate over the list of listener lists */
- Map.Entry entry = (Map.Entry) iter.next();
- eventThread.postEvent((Set) entry.getKey(), (EventDispatcher) entry.getValue(), eventAction, eventObject);
- }
- }
- }
-
- /**
- * Synchronously dispatch an event to the snapshot list. The event may
- * be dispatched on the current thread or an event dispatch thread
- * maintained by the associated EventManager.
- * This method will not return to the caller until the EventDispatcher
- * has been called (and has returned) for each listener on the queue.
- *
- * @param eventAction This value is passed to the EventDispatcher.
- * @param eventObject This object is passed to the EventDispatcher.
- */
- public void dispatchEventSynchronous(int eventAction, Object eventObject) {
- synchronized (this) {
- readOnly = true;
- }
- // We can't guarantee any delivery order for synchronous events.
- // Attempts to do so result in deadly embraces.
- for (Iterator iter = queue.entrySet().iterator(); iter.hasNext();) { /* iterate over the list of listener lists */
- Map.Entry entry = (Map.Entry) iter.next();
- EventManager.dispatchEvent((Set) entry.getKey(), (EventDispatcher) entry.getValue(), eventAction, eventObject);
- }
- }
-}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/package.html b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/package.html
deleted file mode 100644
index 41e344cab..000000000
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/package.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-Provides the event manager API.
-<h2>
-Package Specification</h2>
-This package specifies the API for the event manager.
-<p>
-Clients which implement an event bus to deliver synchronous and/or asynchronous
-events to listeners will likely be interested in the types provided by this package.
-</p>
-</body>
-</html>
diff --git a/releng/org.eclipse.equinox.launcher.releng/.project b/releng/org.eclipse.equinox.launcher.releng/.project
deleted file mode 100644
index 8433d045d..000000000
--- a/releng/org.eclipse.equinox.launcher.releng/.project
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.launcher.releng</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
diff --git a/releng/org.eclipse.equinox.launcher.releng/build.xml b/releng/org.eclipse.equinox.launcher.releng/build.xml
deleted file mode 100644
index 506bb882c..000000000
--- a/releng/org.eclipse.equinox.launcher.releng/build.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!--
- Copyright (c) 2009 IBM Corporation and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- IBM Corporation - initial API and implementation
- -->
-<project name="Launcher Build" basedir="." default="build">
- <property name="cvsLogin" value=":pserver:anonymous" />
- <property name="cvsRoot" value="${cvsLogin}@dev.eclipse.org:/cvsroot/rt" />
- <property name="cvsrsh" value="ssh" />
- <property name="cvsExecutablePath" value="org.eclipse.equinox/framework/bundles/org.eclipse.equinox.executable" />
- <property name="cvsTag" value="HEAD" />
-
- <!-- Macro for execing scp -->
- <macrodef name="SCP">
- <attribute name="dir" />
- <attribute name="source"/>
- <attribute name="destination" />
- <attribute name="failonerror" default="true" />
- <sequential>
- <echo message="Copying @{source} to @{destination}."/>
- <exec dir="@{dir}" executable="scp" failonerror="@{failonerror}">
- <arg value="-q"/>
- <arg line="@{source}" />
- <arg value="@{destination}" />
- </exec>
- </sequential>
- </macrodef>
-
- <!-- macro to resolve properties because we can't do ${${prop}} -->
- <macrodef name="resolveProperty">
- <attribute name="name" />
- <attribute name="value" />
- <sequential>
- <condition property="@{name}" value="${@{value}}" >
- <isset property="@{value}"/>
- </condition>
- </sequential>
- </macrodef>
-
- <target name="init_exeFolder" >
- <!-- set to "bin" or "contributed" according to which folder under org.eclipse.equinox.executable to store the built eclipse -->
- <condition property="exeFolder" value="contributed" else="bin">
- <or>
- <equals arg1="s390" arg2="${arch}" />
- <equals arg1="s390x" arg2="${arch}" />
- <equals arg1="motif.sparc" arg2="${ws}.${arch}" />
- <equals arg1="win32.ia64" arg2="${ws}.${arch}" />
- </or>
- </condition>
- </target>
-
- <target name="init_fragment" >
- <!-- set to "contributed" or "fragments" according to which folder under org.eclipse.equinox.launcher to find the fragment -->
- <condition property="subFolder" value="contributed" else="fragments">
- <or>
- <equals arg1="s390" arg2="${arch}" />
- <equals arg1="s390x" arg2="${arch}" />
- <equals arg1="solaris.x86" arg2="${os}.${arch}" />
- </or>
- </condition>
- <!-- mac only has arch in fragment name for x86_64 -->
- <condition property="fragmentFolder" value="${subFolder}/org.eclipse.equinox.launcher.${ws}.${os}.${arch}"
- else="${subFolder}/org.eclipse.equinox.launcher.${ws}.${os}" >
- <not>
- <and>
- <equals arg1="macosx" arg2="${os}"/>
- <not> <equals arg1="x86_64" arg2="${arch}"/> </not>
- </and>
- </not>
- </condition>
- </target>
-
- <target name="fetchExecutableSource" >
- <!-- fetch the source and put it in a folder unique to this platform so we don't interfere with other
- compiles if the working folder is shared accross multiple machines -->
- <delete dir="${basedir}/${os}.${ws}.${arch}/library" failonerror="false"/>
- <cvs command="export -d ${os}.${ws}.${arch}/library" tag="${cvsTag}" cvsrsh="${cvsrsh}" package="${cvsExecutablePath}/library" cvsRoot="${cvsRoot}" dest="${basedir}" quiet="true" failonerror="true"/>
- </target>
-
- <target name="buildNix" if="buildNix">
- <!-- exec the build.sh for flavors of unix -->
- <exec dir="${libraryFolder}/${ws}" executable="sh" failonerror="true">
- <arg value="build.sh"/>
- <arg line="-ws ${ws} -os ${os} -arch ${arch}"/>
- <arg line="-java ${javaHome}"/>
- <arg value="clean all" />
- <env key="PATH" value="/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin" />
- </exec>
-
- <!-- copy the resulting executable and .so -->
- <SCP dir="${libraryFolder}/${ws}" source="eclipse" destination="${resultsBaseFolder}/org.eclipse.equinox.executable/${exeFolder}/${ws}/${os}/${arch}" />
- <SCP dir="${libraryFolder}/${ws}" source="eclipse_${maj_ver}${min_ver}.so" destination="${resultsBaseFolder}/org.eclipse.equinox.launcher/${fragmentFolder}" />
-
- <condition property="copyMotifLib" >
- <equals arg1="aix.motif" arg2="${os}.${ws}" />
- </condition>
- <antcall target="copyMotifLib" />
- </target>
-
- <target name="copyMotifLib" if="copyMotifLib" >
- <SCP dir="${libraryFolder}/${ws}" source="libeclipse-motif.so" destination="${resultsBaseFolder}/org.eclipse.equinox.launcher/${fragmentFolder}" failonerror="false" />
- </target>
-
- <target name="buildWindows" if="buildWindows">
- <!-- exec the batch file to build on windows -->
- <exec dir="${libraryFolder}/${ws}" executable="cmd" failonerror="true">
- <arg value="/c" />
- <arg value="build.bat" />
- <arg line="${arch}"/>
- <arg value="-java"/>
- <arg value="${javaHome}"/>
- <arg line="clean all" />
- </exec>
-
- <SCP dir="${libraryFolder}/${ws}" source="eclipse.exe eclipsec.exe" destination="${resultsBaseFolder}/org.eclipse.equinox.executable/${exeFolder}/${ws}/${os}/${arch}" />
- <SCP dir="${libraryFolder}/${ws}" source="eclipse_${maj_ver}${min_ver}.dll" destination="${resultsBaseFolder}/org.eclipse.equinox.launcher/${fragmentFolder}" />
- <condition property="copyWPF">
- <equals arg1="${ws}" arg2="wpf" />
- </condition>
- <antcall target="copyWPF" />
- </target>
-
- <target name="copyWPF" if="copyWPF" >
- <SCP dir="${libraryFolder}/${ws}" source="com_${maj_ver}${min_ver}.dll" destination="${resultsBaseFolder}/org.eclipse.equinox.launcher/${fragmentFolder}" failonerror="false" />
- </target>
-
- <target name="buildMac" if="buildMac">
- <exec dir="${libraryFolder}/carbon" executable="sh" failonerror="true">
- <arg value="build.sh"/>
- <arg line="-ws ${ws} -arch ${arch}"/>
- <arg value="clean all" />
- <env key="PATH" value="/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:${extraPath}" />
- </exec>
-
- <SCP dir="${libraryFolder}/carbon" source="eclipse" destination="${resultsBaseFolder}/org.eclipse.equinox.executable/${exeFolder}/${ws}/${os}/${arch}/Eclipse.app/Contents/MacOS" />
- <SCP dir="${libraryFolder}/carbon" source="eclipse_${maj_ver}${min_ver}.so" destination="${resultsBaseFolder}/org.eclipse.equinox.launcher/${fragmentFolder}" />
- <!-- x86 and ppc are the same universal binary, copy to both under the executable feature -->
- <condition property="copyMacPPC">
- <equals arg1="${arch}" arg2="x86" />
- </condition>
- <antcall target="copyMacPPC" />
- </target>
-
- <target name="copyMacPPC" if="copyMacPPC" >
- <SCP dir="${libraryFolder}/carbon" source="eclipse" destination="${resultsBaseFolder}/org.eclipse.equinox.executable/${exeFolder}/${ws}/${os}/ppc/Eclipse.app/Contents/MacOS" />
- </target>
-
- <target name="determineBuild" >
- <condition property="buildWindows" >
- <equals arg1="${os}" arg2="win32"/>
- </condition>
- <condition property="buildMac" >
- <equals arg1="${os}" arg2="macosx" />
- </condition>
- <condition property="buildNix" >
- <not><or>
- <isset property="buildWindows" />
- <isset property="buildMac" />
- </or></not>
- </condition>
- </target>
-
- <target name="initProperties" >
- <property name="ws" value="${env.ws}"/>
- <property name="os" value="${env.os}" />
- <property name="arch" value="${env.arch}" />
-
- <resolveProperty name="machine" value="m_${os}.${arch}" />
- <resolveProperty name="javaArg" value="j_${os}.${arch}" />
- <resolveProperty name="userName" value="u_${os}.${arch}" />
-
- <!-- windows is built locally, everything else is remote -->
- <condition property="local" >
- <equals arg1="${os}" arg2="win32"/>
- </condition>
- <condition property="remote" >
- <not> <isset property="local"/> </not>
- </condition>
-
- <!-- working directory defaults for our machines. Others should
- pass in workspace as a property on the command line -->
- <condition property="workspace" value="/Users/swtbuild/build/equinox" >
- <equals arg1="${os}" arg2="macosx"/>
- </condition>
- <condition property="workspace" value="~/equinox" >
- <equals arg1="${os}.${arch}" arg2="solaris.x86" />
- </condition>
- <property name="workspace" value="/bluebird/teamswt/equinox" />
- </target>
-
-
- <!--
- Main entry point. We expect the following properties:
- os, ws, arch - to be passed as ant properties or set as environment variables.
- resultsBaseFolder - location to scp the resulting binaries to, usually a workspace containing the executable & launcher projects (eg: user@machine:~/workspace)
- m_<os>.<arch> - name of a machine to ssh to for this os & arch
- u_<os>.<arch> - optional user on the machine for this platform
- j_<os>.<arch> - location of a jdk we can compile against
- We expect ssh keys to be set up so that we don't need passwords
-
- The j_<os>.<arch> properties work together with remote.sh, and are either
- -javaHome /path/to/jdk
- or -java relative/path/to/jdk
- -->
- <target name="build" depends="initProperties">
- <echo message="Building for ${os}, ${ws}, ${arch}"/>
- <antcall target="buildLocal" />
- <antcall target="buildRemote" />
- </target>
-
- <target name="buildLocal" if="local" >
- <condition property="javaHome" value="${j_win32}" else="${java.home}" >
- <isset property="j_win32"/>
- </condition>
- <antcall target="buildConfig" />
- </target>
-
- <target name="buildRemote" if="remote">
- <echo message="Machine: ${machine}" />
- <condition property="scpDest" value="${userName}@${machine}" else="${machine}" >
- <isset property="userName" />
- </condition>
- <condition property="sshUser" value="-l ${userName}" else="" >
- <isset property="userName" />
- </condition>
- <SCP dir="${basedir}" source="remote.sh build.xml" destination="${scpDest}:${workspace}" />
- <echo message="Execing ssh ${machine}" />
- <exec executable="ssh" failonerror="true" >
- <arg line="${sshUser} ${machine}" />
- <arg line="sh ${workspace}/remote.sh" />
- <arg line="${javaArg}" />
- <arg line="-Dos=${os} -Dws=${ws} -Darch=${arch} -DcvsLogin=${cvsLogin}" />
- <arg value="-DresultsBaseFolder=${resultsBaseFolder}" />
- </exec>
- </target>
-
- <target name="buildConfig" depends="init_exeFolder,init_fragment,determineBuild" >
- <antcall target="fetchExecutableSource" />
- <property name="javaHome" value="${java.home}/.." />
- <property name="libraryFolder" value="${basedir}/${os}.${ws}.${arch}/library" />
- <property file="${libraryFolder}/make_version.mak" />
-
- <antcall target="buildNix" />
- <antcall target="buildWindows" />
- <antcall target="buildMac" />
- </target>
-
-</project>
-
-
-
-
diff --git a/releng/org.eclipse.equinox.launcher.releng/remote.sh b/releng/org.eclipse.equinox.launcher.releng/remote.sh
deleted file mode 100644
index 82eb226dc..000000000
--- a/releng/org.eclipse.equinox.launcher.releng/remote.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-#the directory containing this script
-scriptDir=`dirname "$0"`
-
-ANT_HOME=/bluebird/teamswt/swt-builddir/build/apache-ant-1.7.1
-extraArgs=""
-
-while [ "$1" != "" ]; do
- if [ "$1" = "-java" ] && [ "$2" != "" ]; then
- JAVA_HOME=/bluebird/teamswt/swt-builddir/build/JRE/$2
- shift
- elif [ "$1" = "-javaHome" ] && [ "$2" != "" ]; then
- JAVA_HOME="$2"
- shift
- elif [ "$1" = "-antHome" ] && [ "$2" != "" ]; then
- ANT_HOME="$2"
- shift
- else
- extraArgs="$extraArgs $1"
- fi
- shift
-done
-
-OS=`uname -s`
-case $OS in
- "SunOS")
- if [ "$PROC" = "" ]; then
- PROC=`uname -p`
- fi
- case ${PROC} in
- "i386")
- ANT_HOME=~/equinox/apache-ant-1.7.1
- ;;
- esac
- ;;
- "AIX")
- PATH=/bluebird/teamswt/swt-builddir/build/cvs_bin/AIX:$PATH
- ;;
-esac
-
-PATH=$JAVA_HOME/jre/bin:$ANT_HOME/bin:$PATH
-
-export JAVA_HOME ANT_HOME PATH
-echo JAVA_HOME = $JAVA_HOME
-echo ANT_HOME = $ANT_HOME
-echo ant -f ${scriptDir}/build.xml buildConfig $extraArgs
-ant -f ${scriptDir}/build.xml buildConfig $extraArgs

Back to the top