Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfogell2006-02-08 20:32:13 +0000
committerjfogell2006-02-08 20:32:13 +0000
commit4a1946965c5fc8ea61b8ae79e0ec4fe33e5f70d8 (patch)
tree1d12a139020a3952b748a559307cd1df45849977
parentd77b5ed8e82ebbe9065efdc8f80411c96a743044 (diff)
downloadrt.equinox.bundles-4a1946965c5fc8ea61b8ae79e0ec4fe33e5f70d8.tar.gz
rt.equinox.bundles-4a1946965c5fc8ea61b8ae79e0ec4fe33e5f70d8.tar.xz
rt.equinox.bundles-4a1946965c5fc8ea61b8ae79e0ec4fe33e5f70d8.zip
removed compile warnings per bug #125841
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Activator.java10
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ConsumersCustomizer.java2
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/LogTracker.java1
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ProducersCustomizer.java2
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ReadOnlyDictionary.java4
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Wire.java3
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdmin.java313
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminEventProducer.java2
-rw-r--r--bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminStore.java6
9 files changed, 204 insertions, 139 deletions
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Activator.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Activator.java
index d703e417f..73594576b 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Activator.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Activator.java
@@ -17,7 +17,7 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer;
public class Activator implements BundleActivator, ServiceTrackerCustomizer {
- private String wireadminString = "org.osgi.service.wireadmin.WireAdmin";
+ private String wireadminString = "org.osgi.service.wireadmin.WireAdmin"; //$NON-NLS-1$
private WireAdmin wireadmin;
private ServiceRegistration wireadminReg;
private PreferencesService preferencesService;
@@ -27,9 +27,9 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
/**
* @see BundleActivator#start(BundleContext)
*/
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context_) throws Exception {
- this.context = context;
+ this.context = context_;
prefsTracker = new ServiceTracker(context, PreferencesService.class.getName(), this);
prefsTracker.open();
}
@@ -37,7 +37,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
/**
* @see BundleActivator#stop(BundleContext)
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context_) throws Exception {
if(wireadminReg != null)
{
wireadminReg.unregister();
@@ -56,7 +56,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
return null; //we don't want to track a service we are not using
}
- public void modifiedService(ServiceReference reference, Object service) {
+ public void modifiedService(ServiceReference reference, Object service) { //do nothing
}
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ConsumersCustomizer.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ConsumersCustomizer.java
index 78282821d..8e866abdf 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ConsumersCustomizer.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ConsumersCustomizer.java
@@ -46,7 +46,7 @@ public class ConsumersCustomizer implements ServiceTrackerCustomizer {
* @see ServiceTrackerCustomizer#modifiedService(ServiceReference, Object)
*/
public void modifiedService(ServiceReference reference, Object service) {
-
+ //do nothing
}
/**
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/LogTracker.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/LogTracker.java
index 19a6ba15f..67b8cd1ee 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/LogTracker.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/LogTracker.java
@@ -79,6 +79,7 @@ public class LogTracker extends ServiceTracker implements LogService {
try {
service.log(reference, level, message, exception);
} catch (Exception e) {
+ //do nothing
}
}
}
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ProducersCustomizer.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ProducersCustomizer.java
index 5ed4fe127..55ce4864f 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ProducersCustomizer.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ProducersCustomizer.java
@@ -47,7 +47,7 @@ public class ProducersCustomizer implements ServiceTrackerCustomizer {
* @see ServiceTrackerCustomizer#modifiedService(ServiceReference, Object)
*/
public void modifiedService(ServiceReference reference, Object service) {
-
+ //do nothing
}
/**
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ReadOnlyDictionary.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ReadOnlyDictionary.java
index b41e885c8..bc5a49318 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ReadOnlyDictionary.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/ReadOnlyDictionary.java
@@ -14,6 +14,10 @@ import java.util.*;
public class ReadOnlyDictionary extends Hashtable {
+ /**
+ * Serial Version UID
+ */
+ private static final long serialVersionUID = 2878360633574220743L;
private Dictionary dictionary;
public ReadOnlyDictionary(Dictionary dictionary) {
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Wire.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Wire.java
index a79250bda..1ba108cf3 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Wire.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/Wire.java
@@ -379,7 +379,8 @@ public class Wire implements org.osgi.service.wireadmin.Wire {
protected void setProducerProperties(ServiceReference reference) {
producerFlavors = (Class[]) reference.getProperty(WireConstants.WIREADMIN_PRODUCER_FLAVORS);
- String[] keys = reference.getPropertyKeys();
+ //TODO - this method need to be completed
+ //String[] keys = reference.getPropertyKeys();
//need to find out if WIREADMIN_PRODUCER_FILTERS key exists
if (reference.getProperty(WireConstants.WIREADMIN_PRODUCER_FILTERS) != null) {
producerFilterExists = true;
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdmin.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdmin.java
index a634f4a9a..aa186136e 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdmin.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdmin.java
@@ -10,30 +10,48 @@
*******************************************************************************/
package org.eclipse.equinox.wireadmin;
-import java.util.*;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
import org.apache.xalan.templates.Constants;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
import org.osgi.service.prefs.PreferencesService;
-import org.osgi.service.wireadmin.*;
+import org.osgi.service.wireadmin.Consumer;
+import org.osgi.service.wireadmin.Producer;
+import org.osgi.service.wireadmin.WireAdminEvent;
+import org.osgi.service.wireadmin.WireConstants;
import org.osgi.util.tracker.ServiceTracker;
public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
protected Vector wires;
+
protected BundleContext context;
+
protected LogTracker log;
+
protected WireAdminEventProducer eventProducer;
protected ServiceReference reference;
protected WireAdminStore wireAdminStore;
+
protected int lastPid;
+
private boolean alive = false;
protected ServiceTracker producerTracker;
+
protected ServiceTracker consumerTracker;
protected final String consumerFilter = "(" + WireConstants.WIREADMIN_CONSUMER_PID + "="; //$NON-NLS-1$ //$NON-NLS-2$
+
protected final String producerFilter = "(" + WireConstants.WIREADMIN_PRODUCER_PID + "="; //$NON-NLS-1$ //$NON-NLS-2$
protected PreferencesService preferencesService;
@@ -44,73 +62,78 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
}
/**
- * Create a new <tt>Wire</tt> object that connects a <tt>Producer</tt> service to a <tt>Consumer</tt> service.
- *
+ * Create a new <tt>Wire</tt> object that connects a <tt>Producer</tt>
+ * service to a <tt>Consumer</tt> service.
+ *
* The <tt>Producer</tt> service and <tt>Consumer</tt> service do not
* have to be registered when the the <tt>Wire</tt> object is created.
- *
- * <p>The <tt>Wire</tt> configuration data is persistently stored.
- * All <tt>Wire</tt> connections are reestablished when the
- * <tt>WireAdmin</tt> service is registered.
- * A <tt>Wire</tt> connection can be removed by using the
- * {@link #deleteWire} method.
- *
- * <p>The <tt>Wire</tt> object's properties must have case
- * insensitive <tt>String</tt> objects as keys (like the Framework).
- * However, the case of the key must be preserved.
- * The type of the value of the property must be one of the following:
- *
+ *
+ * <p>
+ * The <tt>Wire</tt> configuration data is persistently stored. All
+ * <tt>Wire</tt> connections are reestablished when the <tt>WireAdmin</tt>
+ * service is registered. A <tt>Wire</tt> connection can be removed by
+ * using the {@link #deleteWire} method.
+ *
+ * <p>
+ * The <tt>Wire</tt> object's properties must have case insensitive
+ * <tt>String</tt> objects as keys (like the Framework). However, the case
+ * of the key must be preserved. The type of the value of the property must
+ * be one of the following:
+ *
* <pre>
- * type = basetype
- * | vector | arrays
- * basetype = String | Integer | Long
- * | Float | Double | Byte
- * | Short | BigInteger
- * | BigDecimal | Character
- * | Boolean
- * primitive = long | int | short
- * | char | byte | double | float
- * arrays = primitive '[]' | basetype '[]'
- * vector = Vector of basetype
+ * type = basetype
+ * | vector | arrays
+ * basetype = String | Integer | Long
+ * | Float | Double | Byte
+ * | Short | BigInteger
+ * | BigDecimal | Character
+ * | Boolean
+ * primitive = long | int | short
+ * | char | byte | double | float
+ * arrays = primitive '[]' | basetype '[]'
+ * vector = Vector of basetype
* </pre>
- *
- * <p>The <tt>WireAdmin</tt> service must automatically add the
- * following <tt>Wire</tt> properties:
+ *
+ * <p>
+ * The <tt>WireAdmin</tt> service must automatically add the following
+ * <tt>Wire</tt> properties:
* <ul>
- * <li>
- * {@link #WIREADMIN_PID} set to the value of the wire's
- * persistent identity (PID). This value is generated by the
- * <tt>WireAdmin</tt> service when a <tt>Wire</tt> object is created.
- * </li>
- * <li>
- * {@link #WIREADMIN_PRODUCER_PID} set to the value of
- * <tt>Producer</tt> service's PID.
- * </li>
- * <li>
- * {@link #WIREADMIN_CONSUMER_PID} set to the value of
- * <tt>Consumer</tt> service's PID.
- * </li>
+ * <li> {@link #WIREADMIN_PID} set to the value of the wire's persistent
+ * identity (PID). This value is generated by the <tt>WireAdmin</tt>
+ * service when a <tt>Wire</tt> object is created. </li>
+ * <li> {@link #WIREADMIN_PRODUCER_PID} set to the value of
+ * <tt>Producer</tt> service's PID. </li>
+ * <li> {@link #WIREADMIN_CONSUMER_PID} set to the value of
+ * <tt>Consumer</tt> service's PID. </li>
* </ul>
- * If the <tt>properties</tt> argument
- * already contains any of these keys, then the supplied values
- * are replaced with the values assigned by the <tt>WireAdmin</tt> service.
- *
- * <p>The Wire Admin service must generate a {@link #WIREADMIN_CREATED} event after
- * the new <tt>Wire</tt> object becomes available from {@link #getWires}.
- *
- * @param producerPID The &quot;service.pid&quot; of the <tt>Producer</tt> service
- * to be connected to the <tt>Wire</tt>.
- * @param consumerPID The &quot;service.pid&quot; of the <tt>Consumer</tt> service
- * to be connected to the <tt>Wire</tt>.
- * @param properties The <tt>Wire</tt> object's properties. This argument may be <tt>null</tt>
- * if the caller does not wish to define any <tt>Wire</tt> object's properties.
+ * If the <tt>properties</tt> argument already contains any of these keys,
+ * then the supplied values are replaced with the values assigned by the
+ * <tt>WireAdmin</tt> service.
+ *
+ * <p>
+ * The Wire Admin service must generate a {@link #WIREADMIN_CREATED} event
+ * after the new <tt>Wire</tt> object becomes available from
+ * {@link #getWires}.
+ *
+ * @param producerPID
+ * The &quot;service.pid&quot; of the <tt>Producer</tt> service
+ * to be connected to the <tt>Wire</tt>.
+ * @param consumerPID
+ * The &quot;service.pid&quot; of the <tt>Consumer</tt> service
+ * to be connected to the <tt>Wire</tt>.
+ * @param properties
+ * The <tt>Wire</tt> object's properties. This argument may be
+ * <tt>null</tt> if the caller does not wish to define any
+ * <tt>Wire</tt> object's properties.
* @return The <tt>Wire</tt> object for this connection.
- * @throws java.lang.IllegalArgumentException If
- * <tt>properties</tt> contains case variants of the same key name.
+ * @throws java.lang.IllegalArgumentException
+ * If <tt>properties</tt> contains case variants of the same
+ * key name.
*/
- public synchronized org.osgi.service.wireadmin.Wire createWire(String producerPID, String consumerPID, Dictionary properties) {
+ public synchronized org.osgi.service.wireadmin.Wire createWire(
+ String producerPID, String consumerPID, Dictionary properties) {
checkAlive();
- //generate PID
+ // generate PID
lastPid++;
String pid = String.valueOf(lastPid);
if (consumerPID == null || producerPID == null) {
@@ -125,14 +148,16 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
wireAdminStore.addWire(wire, properties);
} catch (Exception ex) {
- log.log(log.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
+ log.log(LogService.LOG_ERROR,
+ WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
}
eventProducer.generateEvent(WireAdminEvent.WIRE_CREATED, wire, null);
return (wire);
}
- protected Wire createWire(String pid, String producerPID, String consumerPID, Dictionary properties) {
+ protected Wire createWire(String pid, String producerPID,
+ String consumerPID, Dictionary properties) {
Wire wire = new Wire(pid, producerPID, consumerPID, properties, this);
wires.addElement(wire);
wire.init();
@@ -140,19 +165,22 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
}
/**
- * Disconnect a <tt>Producer</tt> service from a <tt>Consumer</tt> service.
- *
- * <p>The connection between
- * a <tt>Producer</tt> service and a <tt>Consumer</tt> service is
- * removed.
- * The persistently stored configuration data for the <tt>Wire</tt> object
- * is destroyed. The <tt>Wire</tt> object's method {@link Wire#isValid} will return <tt>false</tt>
- * after it is destroyed.
- *
- * <p>The Wire Admin service must generate a {@link #WIREADMIN_DELETED} event after
- * the <tt>Wire</tt> object becomes invalid.
- *
- * @param wire The <tt>Wire</tt> object which is to be disconnected.
+ * Disconnect a <tt>Producer</tt> service from a <tt>Consumer</tt>
+ * service.
+ *
+ * <p>
+ * The connection between a <tt>Producer</tt> service and a
+ * <tt>Consumer</tt> service is removed. The persistently stored
+ * configuration data for the <tt>Wire</tt> object is destroyed. The
+ * <tt>Wire</tt> object's method {@link Wire#isValid} will return
+ * <tt>false</tt> after it is destroyed.
+ *
+ * <p>
+ * The Wire Admin service must generate a {@link #WIREADMIN_DELETED} event
+ * after the <tt>Wire</tt> object becomes invalid.
+ *
+ * @param wire
+ * The <tt>Wire</tt> object which is to be disconnected.
*/
public void deleteWire(org.osgi.service.wireadmin.Wire wire) {
checkAlive();
@@ -161,28 +189,35 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
wireAdminStore.removeWire((Wire) wire);
} catch (Exception ex) {
- log.log(log.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
+ log.log(LogService.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION,
+ ex);
}
eventProducer.generateEvent(WireAdminEvent.WIRE_DELETED, wire, null);
}
/**
* Update the properties of a <tt>Wire</tt> object.
- *
+ *
* The persistently stored configuration data for the <tt>Wire</tt> object
- * is updated with the new properties and then the <tt>Consumer</tt> and <tt>Producer</tt>
- * services will be called with the respective {@link Consumer#producersConnected}
- * and {@link Producer#consumersConnected} methods.
- * methods..
- *
- * <p>The Wire Admin service must generate a {@link #WIREADMIN_UPDATED} event after
- * the new <tt>properties</tt> become available from the <tt>Wire</tt> object.
- *
- * @param wire The <tt>Wire</tt> object which is to be updated.
- * @param properties The new <tt>Wire</tt> object's properties or <tt>null</tt> if no properties are required.
+ * is updated with the new properties and then the <tt>Consumer</tt> and
+ * <tt>Producer</tt> services will be called with the respective
+ * {@link Consumer#producersConnected} and
+ * {@link Producer#consumersConnected} methods. methods..
+ *
+ * <p>
+ * The Wire Admin service must generate a {@link #WIREADMIN_UPDATED} event
+ * after the new <tt>properties</tt> become available from the
+ * <tt>Wire</tt> object.
+ *
+ * @param wire
+ * The <tt>Wire</tt> object which is to be updated.
+ * @param properties
+ * The new <tt>Wire</tt> object's properties or <tt>null</tt>
+ * if no properties are required.
*/
- public void updateWire(org.osgi.service.wireadmin.Wire wire, Dictionary properties) {
+ public void updateWire(org.osgi.service.wireadmin.Wire wire,
+ Dictionary properties) {
checkAlive();
checkProperties(properties);
if (!wire.isValid()) {
@@ -192,7 +227,8 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
wireAdminStore.updateWire((Wire) wire, properties);
} catch (Exception ex) {
- log.log(log.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
+ log.log(LogService.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION,
+ ex);
}
try {
Consumer consumer = ((org.eclipse.equinox.wireadmin.Wire) wire).consumer;
@@ -205,47 +241,57 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
if (producer != null) {
producer.consumersConnected(wireArray);
}
- eventProducer.generateEvent(WireAdminEvent.WIRE_UPDATED, wire, null);
+ eventProducer
+ .generateEvent(WireAdminEvent.WIRE_UPDATED, wire, null);
} catch (Exception ex) {
- //???
- log.log(log.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
+ // ???
+ log.log(LogService.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION,
+ ex);
}
}
/**
* Return the <tt>Wire</tt> objects that match the given <tt>filter</tt>.
- *
- * <p>The list of available <tt>Wire</tt> objects is matched against the
+ *
+ * <p>
+ * The list of available <tt>Wire</tt> objects is matched against the
* specified <tt>filter</tt>. <tt>Wire</tt> objects which match the
- * <tt>filter</tt> are returned. These <tt>Wire</tt> objects are not necessarily
- * connected. The Wire Admin service should not return
- * invalid <tt>Wire</tt> objects, but it is possible that a <tt>Wire</tt>
- * object is deleted after it was placed in the list.
- *
- * <p>The filter matches against the <tt>Wire</tt> object's properties including
- * {@link Constants#WIREADMIN_PRODUCER_PID}, {@link Constants#WIREADMIN_CONSUMER_PID}
- * and {@link Constants#WIREADMIN_PID}.
- *
- * @param filter Filter string to select <tt>Wire</tt> objects
- * or <tt>null</tt> to select all <tt>Wire</tt> objects.
- * @return An array of <tt>Wire</tt> objects which match the <tt>filter</tt>
- * or <tt>null</tt> if no <tt>Wire</tt> objects match the <tt>filter</tt>.
- * @throws org.osgi.framework.InvalidSyntaxException If the specified <tt>filter</tt>
- * has an invalid syntax.
+ * <tt>filter</tt> are returned. These <tt>Wire</tt> objects are not
+ * necessarily connected. The Wire Admin service should not return invalid
+ * <tt>Wire</tt> objects, but it is possible that a <tt>Wire</tt> object
+ * is deleted after it was placed in the list.
+ *
+ * <p>
+ * The filter matches against the <tt>Wire</tt> object's properties
+ * including {@link Constants#WIREADMIN_PRODUCER_PID},
+ * {@link Constants#WIREADMIN_CONSUMER_PID} and
+ * {@link Constants#WIREADMIN_PID}.
+ *
+ * @param filter
+ * Filter string to select <tt>Wire</tt> objects or
+ * <tt>null</tt> to select all <tt>Wire</tt> objects.
+ * @return An array of <tt>Wire</tt> objects which match the
+ * <tt>filter</tt> or <tt>null</tt> if no <tt>Wire</tt>
+ * objects match the <tt>filter</tt>.
+ * @throws org.osgi.framework.InvalidSyntaxException
+ * If the specified <tt>filter</tt> has an invalid syntax.
* @see "org.osgi.framework.Filter"
*/
- public org.osgi.service.wireadmin.Wire[] getWires(String filterString) throws InvalidSyntaxException {
+ public org.osgi.service.wireadmin.Wire[] getWires(String filterString)
+ throws InvalidSyntaxException {
checkAlive();
return getWires(filterString, false);
}
- protected Wire[] getConnectedWires(String filterString) throws InvalidSyntaxException {
+ protected Wire[] getConnectedWires(String filterString)
+ throws InvalidSyntaxException {
return getWires(filterString, true);
}
- protected Wire[] getWires(String filterString, boolean connected) throws InvalidSyntaxException {
+ protected Wire[] getWires(String filterString, boolean connected)
+ throws InvalidSyntaxException {
Vector returnedWires;
synchronized (this) {
if (filterString == null) {
@@ -253,10 +299,13 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
}
else {
- Filter filter = context.createFilter(filterString); //We do this first so an
- //InvalidSyntaxException will be
- //thrown even if there are no wires
- //present.
+ Filter filter = context.createFilter(filterString); // We do
+ // this
+ // first so
+ // an
+ // InvalidSyntaxException will be
+ // thrown even if there are no wires
+ // present.
returnedWires = new Vector();
for (int i = 0; i < wires.size(); i++) {
Wire wire = (Wire) wires.elementAt(i);
@@ -281,7 +330,8 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
if (this.reference == null) {
this.reference = reference;
- eventProducer = new WireAdminEventProducer(reference, context, log, this);
+ eventProducer = new WireAdminEventProducer(reference, context, log,
+ this);
}
}
@@ -295,7 +345,8 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
protected void checkAlive() {
if (!alive) {
- throw (new IllegalStateException(WireAdminMsg.WIREADMIN_UNREGISTERED_EXCEPTION));
+ throw (new IllegalStateException(
+ WireAdminMsg.WIREADMIN_UNREGISTERED_EXCEPTION));
}
}
@@ -311,7 +362,8 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
producer.consumersConnected(wireArray);
} catch (Exception ex) {
- eventProducer.generateEvent(WireAdminEvent.PRODUCER_EXCEPTION, null, ex);
+ eventProducer.generateEvent(WireAdminEvent.PRODUCER_EXCEPTION,
+ null, ex);
}
}
@@ -327,7 +379,8 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
consumer.producersConnected(wireArray);
} catch (Exception ex) {
- eventProducer.generateEvent(WireAdminEvent.CONSUMER_EXCEPTION, null, ex);
+ eventProducer.generateEvent(WireAdminEvent.CONSUMER_EXCEPTION,
+ null, ex);
}
}
@@ -340,11 +393,13 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
try {
key = (String) e.nextElement();
} catch (ClassCastException ex) {
- throw new IllegalArgumentException(WireAdminMsg.WIREADMIN_PROP_KEY_MUST_BE_STRING);
+ throw new IllegalArgumentException(
+ WireAdminMsg.WIREADMIN_PROP_KEY_MUST_BE_STRING);
}
key = key.toUpperCase();
if (keys.contains(key)) {
- throw new IllegalArgumentException(WireAdminMsg.WIREADMIN_KEYS_CASE_INSENSITIVE_MATCH);
+ throw new IllegalArgumentException(
+ WireAdminMsg.WIREADMIN_KEYS_CASE_INSENSITIVE_MATCH);
}
keys.add(key);
}
@@ -354,17 +409,21 @@ public class WireAdmin implements org.osgi.service.wireadmin.WireAdmin {
wires = new Vector(10);
log = new LogTracker(context, System.out);
- wireAdminStore = new WireAdminStore(context, this, log, preferencesService);
+ wireAdminStore = new WireAdminStore(context, this, log,
+ preferencesService);
try {
wireAdminStore.init(preferencesService);
} catch (Exception ex) {
- log.log(log.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION, ex);
+ log.log(LogService.LOG_ERROR, WireAdminMsg.BACKING_STORE_READ_EXCEPTION,
+ ex);
}
- consumerTracker = new ServiceTracker(context, Consumer.class.getName(), new ConsumersCustomizer(context, this));
+ consumerTracker = new ServiceTracker(context, Consumer.class.getName(),
+ new ConsumersCustomizer(context, this));
consumerTracker.open();
- producerTracker = new ServiceTracker(context, Producer.class.getName(), new ProducersCustomizer(context, this));
+ producerTracker = new ServiceTracker(context, Producer.class.getName(),
+ new ProducersCustomizer(context, this));
producerTracker.open();
alive = true;
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminEventProducer.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminEventProducer.java
index 22f53c978..a01071bc8 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminEventProducer.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminEventProducer.java
@@ -150,7 +150,7 @@ public class WireAdminEventProducer extends ServiceTracker implements EventDispa
wal.wireAdminEvent(event);
} catch (Throwable t) {
- log.log(wireAdminRef, log.LOG_WARNING, WireAdminMsg.WIREADMIN_EVENT_DISPATCH_ERROR, t);
+ log.log(wireAdminRef, LogService.LOG_WARNING, WireAdminMsg.WIREADMIN_EVENT_DISPATCH_ERROR, t);
}
}
diff --git a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminStore.java b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminStore.java
index c91a632b6..eed71a074 100644
--- a/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminStore.java
+++ b/bundles/org.eclipse.equinox.wireadmin/src/org/eclipse/equinox/wireadmin/WireAdminStore.java
@@ -42,8 +42,8 @@ public class WireAdminStore {
this.log = log;
}
- protected void init(PreferencesService preferencesService) throws BackingStoreException {
- this.preferencesService = preferencesService;
+ protected void init(PreferencesService preferencesService_) throws BackingStoreException {
+ this.preferencesService = preferencesService_;
}
protected void addWire(final Wire wire, final Dictionary properties) throws BackingStoreException {
@@ -149,7 +149,7 @@ public class WireAdminStore {
}
}
- private void storeProperties(Dictionary properties, Preferences node) throws BackingStoreException {
+ protected void storeProperties(Dictionary properties, Preferences node) throws BackingStoreException {
Enumeration e = properties.keys();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();

Back to the top