Author: eglynn
Date: Fri Oct 24 09:15:49 2008
New Revision: 707671
URL: http://svn.apache.org/viewvc?rev=707671&view=rev
Log:
[dOSGi] removing a bunch of tabs inserted by eclipse
Modified:
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
Modified:
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
URL:
http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java?rev=707671&r1=707670&r2=707671&view=diff
==============================================================================
---
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
(original)
+++
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
Fri Oct 24 09:15:49 2008
@@ -51,15 +51,15 @@
String filter,
boolean matchAll,
boolean allServices) {
- processServiceDescriptions(getServiceDescriptions(requestingContext,
interfaceName, filter, false),
- requestingContext,
- interfaceName,
- filter,
+ processServiceDescriptions(getServiceDescriptions(requestingContext,
interfaceName, filter, false),
+ requestingContext,
+ interfaceName,
+ filter,
allServices);
}
protected void processServiceDescriptions(List<ServiceEndpointDescription>
sds,
- BundleContext
requestingContext,
+ BundleContext requestingContext,
String interfaceName,
String filter,
boolean allServices) {
@@ -106,14 +106,12 @@
}
}
- //actualSds.add(sd);
}
} catch (ClassNotFoundException ex) {
LOG.warning("No class can be found for " + interfaceName);
continue;
}
}
- //return actualSds;
}
@SuppressWarnings("unchecked")
@@ -144,58 +142,57 @@
// found some SDs as it may find more suitable SDs ?
if (sds.isEmpty()) {
// try discovery service
-
- // REVISIT Discovery RI will change soon to use standard
"objectClass"
- // property key, instead of "interface-name". At that point we
can
- // just reuse the given filter instead of constructing a
modified one. Also
- // we currently throw away any filter predicates unrelated to
the interface
- // name, which is clearly inappropriate.
-
- String modifiedFilter =
- "(" +
ServiceEndpointDescription.PROP_KEY_INTERFACE_NAME
- + "=" + interfaceName + ")";
+
+ // REVISIT Discovery RI will change soon to use standard
"objectClass"
+ // property key, instead of "interface-name". At that point we can
+ // just reuse the given filter instead of constructing a modified
one. Also
+ // we currently throw away any filter predicates unrelated to the
interface
+ // name, which is clearly inappropriate.
+
+ String modifiedFilter =
+ "(" + ServiceEndpointDescription.PROP_KEY_INTERFACE_NAME
+ + "=" + interfaceName + ")";
- Collection<ServiceEndpointDescription> discovered =
- getFromDiscoveryService(interfaceName, modifiedFilter);
- if (discovered.size() != 0) {
- LOG.info("synchronous lookup discovered " +
discovered.size()
- + " references for interface:
" + interfaceName);
+ Collection<ServiceEndpointDescription> discovered =
+ getFromDiscoveryService(interfaceName, modifiedFilter);
+ if (discovered.size() != 0) {
+ LOG.info("synchronous lookup discovered " + discovered.size()
+ + " references for interface: " + interfaceName);
sds.addAll(discovered);
- } else {
- LOG.info("nothing discovered initially for interface: "
- + interfaceName + ", fallback
to async lookup");
- if (filterValue != null && filterValue.length()
> 0) {
- LOG.fine("installing service listener
for: " + modifiedFilter);
- listenToDiscoveryService(
- new ServiceListener() {
- public void
serviceAvailable(ServiceEndpointDescription sd) {
-
LOG.info("received serviceAvailable callback: "
-
+ sd.getProperties());
-
List<ServiceEndpointDescription> notified =
- new
ArrayList<ServiceEndpointDescription>();
- notified.add(sd);
-
processServiceDescriptions(notified,
-
context,
-
interfaceName,
-
filterValue,
-
matchAll);
-
LOG.fine("removing service listener : " + this);
-
unlistenToDiscoveryService(this);
- }
- public void
serviceModified(ServiceEndpointDescription oldSD,
-
ServiceEndpointDescription newSD) {
- // we don't
currently use this notification, but we could do
- // so to allow
to support transparent service re-location
- }
-
- public void
serviceUnavailable(ServiceEndpointDescription sd) {
- // we don't currently
use this notification, but we could do
- // so to allow
to drive transparent fail-over
- }
- },
- modifiedFilter);
- }
- }
+ } else {
+ LOG.info("nothing discovered initially for interface: "
+ + interfaceName + ", fallback to async lookup");
+ if (filterValue != null && filterValue.length() > 0) {
+ LOG.fine("installing service listener for: " +
modifiedFilter);
+ listenToDiscoveryService(
+ new ServiceListener() {
+ public void
serviceAvailable(ServiceEndpointDescription sd) {
+ LOG.info("received serviceAvailable callback:
"
+ + sd.getProperties());
+ List<ServiceEndpointDescription> notified =
+ new
ArrayList<ServiceEndpointDescription>();
+ notified.add(sd);
+ processServiceDescriptions(notified,
+ context,
+ interfaceName,
+ filterValue,
+ matchAll);
+ LOG.fine("removing service listener : " +
this);
+ unlistenToDiscoveryService(this);
+ }
+ public void
serviceModified(ServiceEndpointDescription oldSD,
+
ServiceEndpointDescription newSD) {
+ // we don't currently use this notification,
but we could do
+ // so to allow to support transparent service
re-location
+ }
+ public void
serviceUnavailable(ServiceEndpointDescription sd) {
+ // we don't currently use this notification,
but we could do
+ // so to allow to drive transparent fail-over
+ }
+ },
+ modifiedFilter);
+ }
+ }
}
// do it just in case too for the moment
Modified:
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
URL:
http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java?rev=707671&r1=707670&r2=707671&view=diff
==============================================================================
---
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
(original)
+++
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
Fri Oct 24 09:15:49 2008
@@ -114,7 +114,7 @@
}
protected Collection<ServiceEndpointDescription> listenToDiscoveryService(
- ServiceListener listener, String filterValue) {
+ ServiceListener listener, String filterValue) {
OsgiService<Discovery> pair = OsgiUtils.getOsgiService(getContext(),
Discovery.class);
if (pair != null) {
@@ -129,7 +129,7 @@
}
protected Collection<ServiceEndpointDescription>
unlistenToDiscoveryService(
- ServiceListener listener) {
+ ServiceListener listener) {
OsgiService<Discovery> pair = OsgiUtils.getOsgiService(getContext(),
Discovery.class);
if (pair != null) {
Modified:
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
URL:
http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java?rev=707671&r1=707670&r2=707671&view=diff
==============================================================================
---
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
(original)
+++
cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
Fri Oct 24 09:15:49 2008
@@ -55,8 +55,8 @@
Map<String, String> endpointInterfaces =
getJavaInterfaceEndpointInterfaceMap(sd);
Map<String, Object> properties = getPropertiesMap(sd);
LOG.info("publish java interfaces: " + javaInterfaces
- + ",\nendpoint interfaces: " +
endpointInterfaces
- + ",\nproperties: " + properties);
+ + ",\nendpoint interfaces: " + endpointInterfaces
+ + ",\nproperties: " + properties);
sdPublished = pair.getService().publishService(javaInterfaces,
endpointInterfaces,
@@ -96,8 +96,9 @@
interfaceClass,
serviceObject);
} catch (IntentUnsatifiedException iue) {
- LOG.info("Did not remote service " + sd.getInterfaceNames()[0]
+ " because intent " +
- iue.getIntent() + " could not be satisfied");
+ LOG.info("Did not remote service " + sd.getInterfaceNames()[0]
+ + " because intent " + iue.getIntent()
+ + " could not be satisfied");
} catch (Exception ex) {
LOG.warning("WARNING : Problem creating a remote endpoint for
" + sd.getInterfaceNames()[0]
+ " from CXF PublishHook, reason is " +
ex.getMessage());