You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/12/11 20:28:28 UTC
svn commit: r1420348 - in /cxf/dosgi/trunk/dsw/cxf-dsw/src:
main/java/org/apache/cxf/dosgi/dsw/
main/java/org/apache/cxf/dosgi/dsw/decorator/
main/java/org/apache/cxf/dosgi/dsw/handlers/
main/java/org/apache/cxf/dosgi/dsw/qos/ main/java/org/apache/cxf/...
Author: dkulp
Date: Tue Dec 11 19:28:20 2012
New Revision: 1420348
URL: http://svn.apache.org/viewvc?rev=1420348&view=rev
Log:
More whitespace and brace cleanup
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java Tue Dec 11 19:28:20 2012
@@ -51,20 +51,20 @@ import org.slf4j.LoggerFactory;
// registered as spring bean -> start / stop called accordingly
public class Activator implements ManagedService, BundleActivator {
private static final int DEFAULT_INTENT_TIMEOUT = 30000;
- private final static Logger LOG = LoggerFactory.getLogger(Activator.class);
+ private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
private static final String CONFIG_SERVICE_PID = "cxf-dsw";
private ServiceRegistration rsaFactoryReg;
private ServiceRegistration decoratorReg;
private IntentTracker intentTracker;
private BundleContext bc;
- public void start(BundleContext bc) throws Exception {
- this.bc = bc;
- start(bc, new Hashtable<String, Object>());
+ public void start(BundleContext bundlecontext) throws Exception {
+ this.bc = bundlecontext;
+ start(bundlecontext, new Hashtable<String, Object>());
}
- private void start(BundleContext bc, Map<String, Object> config) {
- this.bc = bc;
+ private void start(BundleContext bundlecontext, Map<String, Object> config) {
+ this.bc = bundlecontext;
String httpBase = (String) config.get(org.apache.cxf.dosgi.dsw.Constants.HTTP_BASE);
String cxfServletAlisas = (String) config.get(org.apache.cxf.dosgi.dsw.Constants.CXF_SERVLET_ALIAS);
// Disable the fast infoset as it's not compatible (yet) with OSGi
@@ -76,10 +76,11 @@ public class Activator implements Manage
intentTracker.open();
IntentManager intentManager = new IntentManagerImpl(intentMap, DEFAULT_INTENT_TIMEOUT);
HttpServiceManager httpServiceManager = new HttpServiceManager(bc, httpBase, cxfServletAlisas);
- ConfigTypeHandlerFactory configTypeHandlerFactory = new ConfigTypeHandlerFactory(bc, intentManager, httpServiceManager);
+ ConfigTypeHandlerFactory configTypeHandlerFactory
+ = new ConfigTypeHandlerFactory(bc, intentManager, httpServiceManager);
RemoteServiceAdminCore rsaCore = new RemoteServiceAdminCore(bc, configTypeHandlerFactory);
RemoteServiceadminFactory rsaf = new RemoteServiceadminFactory(rsaCore);
- Hashtable<String, Object> props = new Hashtable<String, Object>();
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
String[] supportedIntents = intentMap.keySet().toArray(new String[] {});
String siString = IntentUtils.formatIntents(supportedIntents);
props.put("remote.intents.supported", siString);
@@ -89,10 +90,10 @@ public class Activator implements Manage
decoratorReg = bc.registerService(ServiceDecorator.class.getName(), new ServiceDecoratorImpl(bc), null);
}
- private void registerManagedService(BundleContext bc) {
+ private void registerManagedService(BundleContext bundlecontext) {
Dictionary<String, String> props = new Hashtable<String, String>();
props.put(Constants.SERVICE_PID, CONFIG_SERVICE_PID);
- bc.registerService(ManagedService.class.getName(), this, props);
+ bundlecontext.registerService(ManagedService.class.getName(), this, props);
}
public void stop(BundleContext context) throws Exception {
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java Tue Dec 11 19:28:20 2012
@@ -117,7 +117,7 @@ public class Constants {
@Deprecated
public static final String DEFAULT_HOST_VALUE = "localhost";
@Deprecated
- public final static String USE_MASTER_MAP = "use.master.map";
+ public static final String USE_MASTER_MAP = "use.master.map";
//DSW Identification - TODO do we really need this one?
public static final String DSW_CLIENT_ID = PROVIDER_PREFIX + ".remote.dsw.client";
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java Tue Dec 11 19:28:20 2012
@@ -42,9 +42,9 @@ import org.slf4j.LoggerFactory;
public class ServiceDecoratorImpl implements ServiceDecorator {
private static final Logger LOG = LoggerFactory.getLogger(ServiceDecoratorImpl.class);
+ final List<Rule> decorations = new CopyOnWriteArrayList<Rule>();
private final BundleContext bundleContext;
private final BundleListenerImpl bundleListener;
- final List<Rule> decorations = new CopyOnWriteArrayList<Rule>();
public ServiceDecoratorImpl(BundleContext bc) {
bundleContext = bc;
@@ -72,7 +72,9 @@ public class ServiceDecoratorImpl implem
m.addPropMatch(propMatch.getAttributeValue("name"), propMatch.getAttributeValue("value"));
}
for (Element addProp : (List<Element>) match.getChildren("add-property", ns)) {
- m.addProperty(addProp.getAttributeValue("name"), addProp.getAttributeValue("value"), addProp.getAttributeValue("type", String.class.getName()));
+ m.addProperty(addProp.getAttributeValue("name"),
+ addProp.getAttributeValue("value"),
+ addProp.getAttributeValue("type", String.class.getName()));
}
decorations.add(m);
}
@@ -118,6 +120,7 @@ public class ServiceDecoratorImpl implem
case BundleEvent.STOPPING:
removeDecorations(be.getBundle());
break;
+ default:
}
}
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java Tue Dec 11 19:28:20 2012
@@ -93,11 +93,8 @@ public abstract class AbstractPojoConfig
}
}
- {
- String[] allIntents = IntentUtils.mergeArrays(intents, IntentUtils.getInetntsImplementedByTheService(sd));
- props.put(RemoteConstants.SERVICE_INTENTS, allIntents);
- }
-
+ String[] allIntents = IntentUtils.mergeArrays(intents, IntentUtils.getInetntsImplementedByTheService(sd));
+ props.put(RemoteConstants.SERVICE_INTENTS, allIntents);
props.put(RemoteConstants.ENDPOINT_ID, address);
return props;
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java Tue Dec 11 19:28:20 2012
@@ -36,20 +36,24 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConfigTypeHandlerFactory {
- private static Logger LOG = LoggerFactory.getLogger(ConfigTypeHandlerFactory.class);
+ protected static final String DEFAULT_CONFIGURATION_TYPE = Constants.WS_CONFIG_TYPE;
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigTypeHandlerFactory.class);
+
// protected because of tests
protected final List<String> supportedConfigurationTypes;
- protected final static String DEFAULT_CONFIGURATION_TYPE = Constants.WS_CONFIG_TYPE;
private IntentManager intentManager;
private PojoConfigurationTypeHandler pojoConfigurationTypeHandler;
private JaxRSPojoConfigurationTypeHandler jaxRsPojoConfigurationTypeHandler;
private WsdlConfigurationTypeHandler wsdlConfigurationTypeHandler;
- public ConfigTypeHandlerFactory(BundleContext bc, IntentManager intentManager, HttpServiceManager httpServiceManager) {
+ public ConfigTypeHandlerFactory(BundleContext bc, IntentManager intentManager,
+ HttpServiceManager httpServiceManager) {
this.intentManager = intentManager;
this.pojoConfigurationTypeHandler = new PojoConfigurationTypeHandler(bc, intentManager, httpServiceManager);
- this.jaxRsPojoConfigurationTypeHandler = new JaxRSPojoConfigurationTypeHandler(bc, intentManager, httpServiceManager);
+ this.jaxRsPojoConfigurationTypeHandler = new JaxRSPojoConfigurationTypeHandler(bc,
+ intentManager,
+ httpServiceManager);
this.wsdlConfigurationTypeHandler = new WsdlConfigurationTypeHandler(bc, intentManager, httpServiceManager);
supportedConfigurationTypes = new ArrayList<String>();
supportedConfigurationTypes.add(Constants.WSDL_CONFIG_TYPE);
@@ -74,7 +78,8 @@ public class ConfigTypeHandlerFactory {
Map<String, Object> serviceProperties) {
intentManager.assertAllIntentsSupported(serviceProperties);
if (configurationTypes.contains(Constants.WS_CONFIG_TYPE)
- || configurationTypes.contains(Constants.WS_CONFIG_TYPE_OLD) || configurationTypes.contains(Constants.RS_CONFIG_TYPE)) {
+ || configurationTypes.contains(Constants.WS_CONFIG_TYPE_OLD)
+ || configurationTypes.contains(Constants.RS_CONFIG_TYPE)) {
boolean jaxrs = isJaxrsRequested(configurationTypes, serviceProperties);
@@ -93,7 +98,8 @@ public class ConfigTypeHandlerFactory {
if (types.contains(Constants.RS_CONFIG_TYPE)) {
String intentsProperty = OsgiUtils.getProperty(serviceProperties, RemoteConstants.SERVICE_EXPORTED_INTENTS);
- boolean hasHttpIntent = false, hasSoapIntent = false;
+ boolean hasHttpIntent = false;
+ boolean hasSoapIntent = false;
if (intentsProperty != null) {
String[] intents = IntentUtils.parseIntents(intentsProperty);
for (int i = 0; i < intents.length; i++) {
@@ -152,10 +158,11 @@ public class ConfigTypeHandlerFactory {
}
if (usableConfigurationTypes.size() == 0) {
- throw new RuntimeException("The supplied endpoint has no compatible configuration type. Supported types are: "
- + supportedConfigurationTypes
- + " Types needed by the endpoint: "
- + remoteConfigurationTypes);
+ throw new RuntimeException("The supplied endpoint has no compatible configuration type. "
+ + "Supported types are: "
+ + supportedConfigurationTypes
+ + " Types needed by the endpoint: "
+ + remoteConfigurationTypes);
}
return usableConfigurationTypes;
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java Tue Dec 11 19:28:20 2012
@@ -97,9 +97,9 @@ public class HttpServiceManager {
Constants.RS_HTTP_SERVICE_CONTEXT);
}
- private HttpContext getHttpContext(BundleContext bundleContext, HttpService httpService) {
+ private HttpContext getHttpContext(BundleContext bc, HttpService httpService) {
HttpContext httpContext = httpService.createDefaultHttpContext();
- return new SecurityDelegatingHttpContext(bundleContext, httpContext);
+ return new SecurityDelegatingHttpContext(bc, httpContext);
}
/**
@@ -158,7 +158,8 @@ public class HttpServiceManager {
final String alias = exportedAliases.remove(sid);
if (alias == null) {
LOG.error(
- "Unable to unexport HTTP servlet for service class ''{0}'', service-id {1}: no servlet alias found",
+ "Unable to unexport HTTP servlet for service class ''{0}'',"
+ + " service-id {1}: no servlet alias found",
new Object[] {sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS), sid});
return;
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java Tue Dec 11 19:28:20 2012
@@ -47,7 +47,9 @@ public class JaxRSPojoConfigurationTypeH
Set<ServiceReference> httpServiceReferences = new CopyOnWriteArraySet<ServiceReference>();
- public JaxRSPojoConfigurationTypeHandler(BundleContext dswBC, IntentManager intentManager, HttpServiceManager httpServiceManager) {
+ public JaxRSPojoConfigurationTypeHandler(BundleContext dswBC,
+ IntentManager intentManager,
+ HttpServiceManager httpServiceManager) {
super(dswBC, intentManager, httpServiceManager);
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java Tue Dec 11 19:28:20 2012
@@ -37,11 +37,9 @@ import org.slf4j.LoggerFactory;
public class JaxRSUtils {
- private static final Logger LOG = LoggerFactory.getLogger(JaxRSUtils.class);
-
- public final static String MODEL_FOLDER = "/OSGI-INF/cxf/jaxrs/";
- public final static String DEFAULT_MODEL = "/OSGI-INF/cxf/jaxrs/model.xml";
- public final static String PROVIDERS_FILTER = "(|"
+ public static final String MODEL_FOLDER = "/OSGI-INF/cxf/jaxrs/";
+ public static final String DEFAULT_MODEL = "/OSGI-INF/cxf/jaxrs/model.xml";
+ public static final String PROVIDERS_FILTER = "(|"
+ "(objectClass=javax.ws.rs.ext.MessageBodyReader)"
+ "(objectClass=javax.ws.rs.ext.MessageBodyWriter)"
+ "(objectClass=javax.ws.rs.ext.ExceptionMapper)"
@@ -50,6 +48,8 @@ public class JaxRSUtils {
+ "(objectClass=org.apache.cxf.jaxrs.ext.ParameterHandler)"
+ "(objectClass=org.apache.cxf.jaxrs.ext.ResponseExceptionMapper)"
+ ")";
+ private static final Logger LOG = LoggerFactory.getLogger(JaxRSUtils.class);
+
@SuppressWarnings("rawtypes")
static List<Object> getProviders(BundleContext callingContext, BundleContext dswBC, Map sd) {
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java Tue Dec 11 19:28:20 2012
@@ -29,7 +29,7 @@ import java.util.List;
/**
* Utility methods to get the local address even on a linux host
*/
-public class LocalHostUtil {
+public final class LocalHostUtil {
private LocalHostUtil() {
// Util Class
@@ -46,12 +46,14 @@ public class LocalHostUtil {
*/
public static InetAddress getLocalHost() throws UnknownHostException {
InetAddress localHost = InetAddress.getLocalHost();
- if (!localHost.isLoopbackAddress())
+ if (!localHost.isLoopbackAddress()) {
return localHost;
+ }
InetAddress[] addrs = getAllLocalUsingNetworkInterface();
for (int i = 0; i < addrs.length; i++) {
- if (!addrs[i].isLoopbackAddress() && !addrs[i].getHostAddress().contains(":"))
+ if (!addrs[i].isLoopbackAddress() && !addrs[i].getHostAddress().contains(":")) {
return addrs[i];
+ }
}
return localHost;
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java Tue Dec 11 19:28:20 2012
@@ -42,7 +42,9 @@ import org.slf4j.LoggerFactory;
public class PojoConfigurationTypeHandler extends AbstractPojoConfigurationTypeHandler {
private static final Logger LOG = LoggerFactory.getLogger(PojoConfigurationTypeHandler.class);
- public PojoConfigurationTypeHandler(BundleContext dswBC, IntentManager intentManager, HttpServiceManager httpServiceManager) {
+ public PojoConfigurationTypeHandler(BundleContext dswBC,
+ IntentManager intentManager,
+ HttpServiceManager httpServiceManager) {
super(dswBC, intentManager, httpServiceManager);
}
@@ -84,8 +86,12 @@ public class PojoConfigurationTypeHandle
return null;
}
- public ExportResult createServer(ServiceReference sref, BundleContext dswContext,
- BundleContext callingContext, Map<String, Object> sd, Class<?> iClass, Object serviceBean) throws IntentUnsatifiedException {
+ public ExportResult createServer(ServiceReference sref,
+ BundleContext dswContext,
+ BundleContext callingContext,
+ Map<String, Object> sd,
+ Class<?> iClass,
+ Object serviceBean) throws IntentUnsatifiedException {
String address = getServerAddress(sd, iClass);
String contextRoot = httpServiceManager.getServletContextRoot(sd, iClass);
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java Tue Dec 11 19:28:20 2012
@@ -103,7 +103,7 @@ public class SecurityDelegatingHttpConte
class Chain implements FilterChain {
private static final Logger LOG = LoggerFactory.getLogger(Chain.class);
- int current = 0;
+ int current;
Filter[] filters;
Chain(Filter[] filters) {
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java Tue Dec 11 19:28:20 2012
@@ -33,7 +33,7 @@ import java.util.Map;
import org.osgi.framework.ServiceException;
public class ServiceInvocationHandler implements InvocationHandler {
- private final static String REMOTE_EXCEPTION_TYPE = "REMOTE";
+ private static final String REMOTE_EXCEPTION_TYPE = "REMOTE";
private static final Collection<Method> OBJECT_METHODS =
Arrays.asList(Object.class.getMethods());
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java Tue Dec 11 19:28:20 2012
@@ -91,17 +91,17 @@ public class IntentManagerImpl implement
}
private Collection<String> addSynonymIntents(Collection<String> appliedIntents,
- IntentMap intentMap) {
+ IntentMap map) {
// E.g. SOAP and SOAP.1_1 are synonyms
List<Object> values = new ArrayList<Object>();
for (String key : appliedIntents) {
- values.add(intentMap.get(key));
+ values.add(map.get(key));
}
- return reverseLookup(intentMap, values);
+ return reverseLookup(map, values);
}
- private Collection<String> reverseLookup(IntentMap intentMap, Object obj) {
- return reverseLookup(intentMap, Collections.singleton(obj));
+ private Collection<String> reverseLookup(IntentMap im, Object obj) {
+ return reverseLookup(im, Collections.singleton(obj));
}
/**
@@ -110,9 +110,9 @@ public class IntentManagerImpl implement
* @param objs
* @return
*/
- private Collection<String> reverseLookup(IntentMap intentMap, Collection<? extends Object> objs) {
+ private Collection<String> reverseLookup(IntentMap im, Collection<? extends Object> objs) {
Set<String> intentsFound = new HashSet<String>();
- for (Map.Entry<String, Object> entry : intentMap.entrySet()) {
+ for (Map.Entry<String, Object> entry : im.entrySet()) {
if (objs.contains(entry.getValue())) {
intentsFound.add(entry.getKey());
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java Tue Dec 11 19:28:20 2012
@@ -70,7 +70,8 @@ public class EventProducer {
for (ServiceReference sref : listenerRefs) {
RemoteServiceAdminListener rsal = (RemoteServiceAdminListener)bctx.getService(sref);
if (LOG.isDebugEnabled()) {
- LOG.debug("notify RemoteServiceAdminListener {} of bundle {}" + rsal, sref.getBundle().getSymbolicName());
+ LOG.debug("notify RemoteServiceAdminListener {} of bundle {}" + rsal,
+ sref.getBundle().getSymbolicName());
}
rsal.remoteAdminEvent(rsae);
}
@@ -84,8 +85,8 @@ public class EventProducer {
protected void publishNotifcation(ImportRegistration ir) {
RemoteServiceAdminEvent rsae = null;
if (ir.getException() != null) {
- rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_ERROR, bctx.getBundle(), ir.getImportReference(), ir
- .getException());
+ rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_ERROR, bctx.getBundle(),
+ ir.getImportReference(), ir.getException());
} else {
rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, bctx.getBundle(),
ir.getImportReference(), ir.getException());
@@ -97,7 +98,8 @@ public class EventProducer {
public void notifyRemoval(ExportRegistration eri) {
RemoteServiceAdminEvent rsae = null;
- rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_UNREGISTRATION, bctx.getBundle(), eri.getExportReference(), eri.getException());
+ rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_UNREGISTRATION, bctx.getBundle(),
+ eri.getExportReference(), eri.getException());
notifyListeners(rsae);
eaHelper.notifyEventAdmin(rsae);
@@ -106,7 +108,8 @@ public class EventProducer {
public void notifyRemoval(ImportRegistration eri) {
RemoteServiceAdminEvent rsae = null;
- rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_UNREGISTRATION, bctx.getBundle(), eri.getImportReference(), eri.getException());
+ rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_UNREGISTRATION, bctx.getBundle(),
+ eri.getImportReference(), eri.getException());
notifyListeners(rsae);
eaHelper.notifyEventAdmin(rsae);
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java Tue Dec 11 19:28:20 2012
@@ -55,23 +55,30 @@ public class ExportReferenceImpl impleme
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
ExportReferenceImpl other = (ExportReferenceImpl) obj;
- if (endpointDescription == null) {
- if (other.endpointDescription != null)
+ if (endpointDescription == null) {
+ if (other.endpointDescription != null) {
return false;
- } else if (!endpointDescription.equals(other.endpointDescription))
+ }
+ } else if (!endpointDescription.equals(other.endpointDescription)) {
return false;
+ }
if (serviceReference == null) {
- if (other.serviceReference != null)
+ if (other.serviceReference != null) {
return false;
- } else if (!serviceReference.equals(other.serviceReference))
+ }
+ } else if (!serviceReference.equals(other.serviceReference)) {
return false;
+ }
return true;
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java Tue Dec 11 19:28:20 2012
@@ -32,18 +32,18 @@ import org.slf4j.LoggerFactory;
// *************************** FIXME: some old methods might be in here ****
public class ImportRegistrationImpl implements ImportRegistration {
- private final static Logger LOG = LoggerFactory.getLogger(ImportRegistrationImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ImportRegistrationImpl.class);
private Throwable exception;
private ServiceRegistration importedService;
private EndpointDescription importedEndpoint;
private ClientServiceFactory clientServiceFactory;
private RemoteServiceAdminCore rsaCore;
- private boolean closed = false;
- private boolean detatched = false;
+ private boolean closed;
+ private boolean detatched;
- private ImportRegistrationImpl parent = null;
- private List<ImportRegistrationImpl> childs = null;
+ private ImportRegistrationImpl parent;
+ private List<ImportRegistrationImpl> childs;
private ImportReference importReference;
@@ -58,11 +58,6 @@ public class ImportRegistrationImpl impl
init();
}
- private void init() {
- parent = this;
- childs = new ArrayList<ImportRegistrationImpl>(1);
- }
-
/**
* Create a clone of this object which is linked to this object
*/
@@ -80,6 +75,11 @@ public class ImportRegistrationImpl impl
parent.instanceAdded(this);
}
+ private void init() {
+ parent = this;
+ childs = new ArrayList<ImportRegistrationImpl>(1);
+ }
+
private synchronized void instanceAdded(ImportRegistrationImpl i) {
childs.add(i);
}
@@ -87,11 +87,13 @@ public class ImportRegistrationImpl impl
public synchronized void close() {
LOG.debug("close() called ");
- if (isFailure())
+ if (isFailure()) {
return;
+ }
- if (closed)
+ if (closed) {
return;
+ }
closed = true;
rsaCore.removeImportRegistration(this);
@@ -109,10 +111,12 @@ public class ImportRegistrationImpl impl
LOG.debug("really closing ImportRegistartion now! ");
- if (clientServiceFactory != null)
+ if (clientServiceFactory != null) {
clientServiceFactory.setCloseable(true);
- if (importedService != null)
+ }
+ if (importedService != null) {
importedService.unregister();
+ }
}
}
@@ -126,8 +130,9 @@ public class ImportRegistrationImpl impl
for (ImportRegistrationImpl ir : new ArrayList<ImportRegistrationImpl>(childs)) {
ir.close();
}
- if (!closed)
+ if (!closed) {
this.close();
+ }
} else {
parent.closeAll();
}
@@ -142,20 +147,24 @@ public class ImportRegistrationImpl impl
}
public EndpointDescription getImportedEndpointDescription() {
- if (isFailure())
+ if (isFailure()) {
return null;
- if (closed)
+ }
+ if (closed) {
return null;
+ }
return importedEndpoint;
}
public ServiceReference getImportedService() {
- if (isFailure() || closed)
+ if (isFailure() || closed) {
return null;
+ }
- if (importedService == null)
+ if (importedService == null) {
return null;
+ }
return importedService.getReference();
}
@@ -173,8 +182,9 @@ public class ImportRegistrationImpl impl
}
public synchronized void setImportedServiceRegistration(ServiceRegistration proxyRegistration) {
- if (parent != this)
+ if (parent != this) {
throw new IllegalStateException("this method may only be called on the parent !");
+ }
_setImportedServiceRegistration(proxyRegistration);
for (ImportRegistrationImpl ir : childs) {
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java Tue Dec 11 19:28:20 2012
@@ -60,7 +60,9 @@ import org.osgi.service.remoteserviceadm
public class PojoConfigurationTypeHandlerTest extends TestCase {
public void testGetPojoAddressEndpointURI() {
IntentManager intentManager = new IntentManagerImpl(new IntentMap());
- PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null, intentManager, dummyHttpServiceManager());
+ PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null,
+ intentManager,
+ dummyHttpServiceManager());
Map<String, Object> sd = new HashMap<String, Object>();
String url = "http://somewhere:1234/blah";
sd.put(RemoteConstants.ENDPOINT_ID, url);
@@ -73,7 +75,9 @@ public class PojoConfigurationTypeHandle
public void testGetPojoAddressEndpointCxf() {
IntentManager intentManager = new IntentManagerImpl(new IntentMap());
- PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null, intentManager, dummyHttpServiceManager());
+ PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null,
+ intentManager,
+ dummyHttpServiceManager());
Map<String, Object> sd = new HashMap<String, Object>();
String url = "http://somewhere:29/boo";
sd.put("org.apache.cxf.ws.address", url);
@@ -82,7 +86,9 @@ public class PojoConfigurationTypeHandle
public void testGetPojoAddressEndpointPojo() {
IntentManager intentManager = new IntentManagerImpl(new IntentMap());
- PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null, intentManager, dummyHttpServiceManager());
+ PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null,
+ intentManager,
+ dummyHttpServiceManager());
Map<String, Object> sd = new HashMap<String, Object>();
String url = "http://somewhere:32768/foo";
sd.put("osgi.remote.configuration.pojo.address", url);
@@ -91,7 +97,9 @@ public class PojoConfigurationTypeHandle
public void testGetDefaultPojoAddress() {
IntentManager intentManager = new IntentManagerImpl(new IntentMap());
- PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null, intentManager , dummyHttpServiceManager());
+ PojoConfigurationTypeHandler handler = new PojoConfigurationTypeHandler(null,
+ intentManager ,
+ dummyHttpServiceManager());
Map<String, Object> sd = new HashMap<String, Object>();
assertEquals("/java/lang/String", handler.getServerAddress(sd, String.class));
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java Tue Dec 11 19:28:20 2012
@@ -195,7 +195,7 @@ public class SecurityDelegatingHttpConte
}
class CommitResponseFilter implements Filter {
- public boolean called = false;
+ boolean called;
public void init(FilterConfig filterConfig) throws ServletException {
}
@@ -211,7 +211,7 @@ class CommitResponseFilter implements Fi
}
class DoNothingFilter implements Filter {
- boolean called = false;
+ boolean called;
public void init(FilterConfig filterConfig) throws ServletException {
}
@@ -227,7 +227,7 @@ class DoNothingFilter implements Filter
}
class AccessDeniedFilter implements Filter {
- boolean called = false;
+ boolean called;
public void init(FilterConfig filterConfig) throws ServletException {
}
Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java?rev=1420348&r1=1420347&r2=1420348&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java Tue Dec 11 19:28:20 2012
@@ -36,11 +36,8 @@ import org.easymock.classextension.EasyM
import org.easymock.classextension.IMocksControl;
import org.junit.Test;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-
-public class IntentManagerImplTest {
+public class IntentManagerImplTest extends Assert {
@Test
public void testIntents() throws Exception {
@@ -58,7 +55,6 @@ public class IntentManagerImplTest {
Map<String, Object> props = new HashMap<String, Object>();
props.put("osgi.remote.requires.intents", "A");
- //ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
List<String> effectiveIntents = Arrays.asList(intentManager.applyIntents(features, factory, props));
assertEquals(Arrays.asList("A", "SOAP"), effectiveIntents);
@@ -79,7 +75,6 @@ public class IntentManagerImplTest {
Map<String, Object> props = new HashMap<String, Object>();
props.put("osgi.remote.requires.intents", "transactionality confidentiality.message");
- //ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
List<String> effectiveIntents = Arrays.asList(intentManager.applyIntents(features, factory, props));
assertTrue(effectiveIntents.contains("transactionality"));
@@ -233,7 +228,6 @@ public class IntentManagerImplTest {
Map<String, Object> props = new HashMap<String, Object>();
props.put("osgi.remote.requires.intents", requestedIntents);
- //ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
IntentManagerImpl intentManager = new IntentManagerImpl(intentMap);
intentManager.applyIntents(features, factory, props);
@@ -260,7 +254,6 @@ public class IntentManagerImplTest {
Map<String, Object> props = new HashMap<String, Object>();
props.put("osgi.remote.requires.intents", "B A");
- //ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
IntentManager intentManager = new IntentManagerImpl(intentMap);