You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by jb...@apache.org on 2011/07/21 15:03:57 UTC
svn commit: r1149154 - in
/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi:
framework/ jmx/ security/ security/auth/impl/ security/keystore/impl/
security/login/
Author: jbonofre
Date: Thu Jul 21 13:03:53 2011
New Revision: 1149154
URL: http://svn.apache.org/viewvc?rev=1149154&view=rev
Log:
[SM-2048] Use slf4j as default logging system in place of commons-logging.
Modified:
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentContextImpl.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/AdminReadWritePolicy.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/ConnectorServerFactoryBean.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/auth/impl/JAASAuthenticationService.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/BaseKeystoreManager.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/FileKeystoreInstance.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/CertificatesLoginModule.java
servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/PropertiesLoginModule.java
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentContextImpl.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentContextImpl.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentContextImpl.java Thu Jul 21 13:03:53 2011
@@ -17,7 +17,6 @@
package org.apache.servicemix.jbi.framework;
import java.util.MissingResourceException;
-import java.util.logging.Logger;
import javax.jbi.JBIException;
import javax.jbi.component.Component;
@@ -33,14 +32,15 @@ import javax.xml.namespace.QName;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.container.ComponentEnvironment;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.jbi.container.SubscriptionSpec;
import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* This context provides access to data needed by all JBI components running in the JBI environment.
*
@@ -48,7 +48,7 @@ import org.apache.servicemix.jbi.service
*/
public class ComponentContextImpl implements ComponentContext, MBeanNames {
- private static final Log LOG = LogFactory.getLog(ComponentContextImpl.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(ComponentContextImpl.class);
private ComponentNameSpace componentName;
private ComponentEnvironment environment;
@@ -73,10 +73,8 @@ public class ComponentContextImpl implem
* Activate the ComponentContext
*
* @param comp
- * @param channel
* @param env
* @param spec
- * @param installRoot
*/
public void activate(Component comp,
ComponentEnvironment env,
@@ -120,8 +118,8 @@ public class ComponentContextImpl implem
*/
public ServiceEndpoint activateEndpoint(QName serviceName, String endpointName) throws JBIException {
checkActivated();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Component: " + componentName.getName() + " activated endpoint: " + serviceName + " : " + endpointName);
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Component: " + componentName.getName() + " activated endpoint: " + serviceName + " : " + endpointName);
}
return container.getRegistry().activateEndpoint(this, serviceName, endpointName);
}
@@ -190,7 +188,6 @@ public class ComponentContextImpl implem
/**
* @return the Delivery Channel
- * @throws MessagingException
*/
public DeliveryChannel getDeliveryChannel() {
return deliveryChannel;
@@ -452,7 +449,7 @@ public class ComponentContextImpl implem
* @exception JBIException if the resourceBundleName has changed from a previous invocation by this component of
* this method with the same suffix.
*/
- public Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException, JBIException {
+ public java.util.logging.Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException, JBIException {
String name = suffix != null ? suffix : "";
name = componentName.getName() + name;
return container.getLogger(name, resourceBundleName);
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java Thu Jul 21 13:03:53 2011
@@ -41,8 +41,6 @@ import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.container.EnvironmentContext;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
@@ -57,6 +55,9 @@ import org.apache.servicemix.jbi.managem
import org.apache.servicemix.jbi.util.DOMUtil;
import org.apache.servicemix.jbi.util.FileUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* The deployment service MBean allows administrative tools to manage service assembly deployments.
*
@@ -64,7 +65,7 @@ import org.apache.servicemix.jbi.util.Fi
*/
public class DeploymentService extends BaseSystemService implements DeploymentServiceMBean {
- private static final Log LOG = LogFactory.getLog(DeploymentService.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(DeploymentService.class);
private EnvironmentContext environmentContext;
private Registry registry;
@@ -101,7 +102,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(sas[j]);
sa.init();
} catch (Exception e) {
- LOG.error("Unable to initialize state for service assembly " + sas[j], e);
+ LOGGER.error("Unable to initialize state for service assembly {}", sas[j], e);
}
}
// This loop will restore SAs
@@ -110,7 +111,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(sas[i]);
sa.restore(false); // Do not force init SUs
} catch (Exception e) {
- LOG.error("Unable to restore state for service assembly " + sas[i], e);
+ LOGGER.error("Unable to restore state for service assembly {}", sas[i], e);
}
}
container.getBroker().resume();
@@ -217,7 +218,7 @@ public class DeploymentService extends B
}
return deployServiceAssembly(tmpDir, sa);
} catch (Exception e) {
- LOG.error("Error deploying service assembly", e);
+ LOGGER.error("Error deploying service assembly", e);
throw e;
}
}
@@ -263,7 +264,7 @@ public class DeploymentService extends B
return result;
} catch (Exception e) {
- LOG.info("Unable to undeploy assembly", e);
+ LOGGER.info("Unable to undeploy assembly", e);
throw e;
}
}
@@ -283,7 +284,7 @@ public class DeploymentService extends B
}
return names;
} catch (Exception e) {
- LOG.info("Unable to get deployed service unit list", e);
+ LOGGER.info("Unable to get deployed service unit list", e);
throw e;
}
}
@@ -297,7 +298,7 @@ public class DeploymentService extends B
try {
return registry.getDeployedServiceAssemblies();
} catch (Exception e) {
- LOG.info("Unable to get deployed service assemblies", e);
+ LOGGER.info("Unable to get deployed service assemblies", e);
throw e;
}
}
@@ -328,7 +329,7 @@ public class DeploymentService extends B
try {
return registry.getDeployedServiceAssembliesForComponent(componentName);
} catch (Exception e) {
- LOG.info("Error in getDeployedServiceAssembliesForComponent", e);
+ LOGGER.info("Error in getDeployedServiceAssembliesForComponent", e);
throw e;
}
}
@@ -344,7 +345,7 @@ public class DeploymentService extends B
try {
return registry.getComponentsForDeployedServiceAssembly(saName);
} catch (Exception e) {
- LOG.info("Error in getComponentsForDeployedServiceAssembly", e);
+ LOGGER.info("Error in getComponentsForDeployedServiceAssembly", e);
throw e;
}
}
@@ -361,7 +362,7 @@ public class DeploymentService extends B
try {
return registry.isSADeployedServiceUnit(componentName, suName);
} catch (Exception e) {
- LOG.info("Error in isSADeployedServiceUnit", e);
+ LOGGER.info("Error in isSADeployedServiceUnit", e);
throw e;
}
}
@@ -389,7 +390,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(serviceAssemblyName);
return sa.start(true);
} catch (Exception e) {
- LOG.info("Error in start", e);
+ LOGGER.info("Error in start", e);
throw e;
}
}
@@ -408,7 +409,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(serviceAssemblyName);
return sa.stop(true, false);
} catch (Exception e) {
- LOG.info("Error in stop", e);
+ LOGGER.info("Error in stop", e);
throw e;
}
}
@@ -425,7 +426,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(serviceAssemblyName);
return sa.shutDown(true);
} catch (Exception e) {
- LOG.info("Error in shutDown", e);
+ LOGGER.info("Error in shutDown", e);
throw e;
}
}
@@ -442,7 +443,7 @@ public class DeploymentService extends B
ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(serviceAssemblyName);
return sa.getCurrentState();
} catch (Exception e) {
- LOG.info("Error in getState", e);
+ LOGGER.info("Error in getState", e);
throw e;
}
}
@@ -471,9 +472,7 @@ public class DeploymentService extends B
File saDirectory = env.getInstallDir();
// move the assembly to a well-named holding area
- if (LOG.isDebugEnabled()) {
- LOG.debug("Moving " + tmpDir.getAbsolutePath() + " to " + saDirectory.getAbsolutePath());
- }
+ LOGGER.debug("Moving {} to {}", tmpDir.getAbsolutePath(), saDirectory.getAbsolutePath());
saDirectory.getParentFile().mkdirs();
if (!tmpDir.renameTo(saDirectory)) {
throw ManagementSupport.failure("deploy", "Failed to rename " + tmpDir + " to " + saDirectory);
@@ -498,9 +497,7 @@ public class DeploymentService extends B
try {
File artifactFile = new File(saDirectory, artifact);
targetDir = env.getServiceUnitDirectory(componentName, suName);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Unpack service unit archive " + artifactFile + " to " + targetDir);
- }
+ LOGGER.debug("Unpack service unit archive {} to {}", artifactFile, targetDir);
FileUtil.unpackArchive(artifactFile, targetDir);
} catch (IOException e) {
nbFailures++;
@@ -547,7 +544,7 @@ public class DeploymentService extends B
ServiceUnitLifeCycle su = registry.getServiceUnit(suName);
undeployServiceUnit(su);
} catch (Exception e) {
- LOG.warn("Error undeploying SU", e);
+ LOGGER.warn("Error undeploying SU", e);
}
}
// Delete SA deployment directory
@@ -640,7 +637,7 @@ public class DeploymentService extends B
"Unable to parse result string", e);
}
} catch (Exception e2) {
- LOG.error(e2);
+ LOGGER.error(e2.getMessage());
result = null;
}
}
@@ -692,14 +689,14 @@ public class DeploymentService extends B
} else {
FileUtil.deleteFile(targetDir);
}
- LOG.info("UnDeployed ServiceUnit " + name + " from Component: " + componentName);
+ LOGGER.info("UnDeployed ServiceUnit {} from Component: {}", name, componentName);
}
/**
* Find runnning state and things deployed before shutdown
*/
protected void buildState() {
- LOG.info("Restoring service assemblies");
+ LOGGER.info("Restoring service assemblies");
// walk through deployed SA's
File top = environmentContext.getServiceAssembliesDir();
if (top == null || !top.exists() || !top.isDirectory()) {
@@ -723,7 +720,7 @@ public class DeploymentService extends B
}
}
} catch (Exception e) {
- LOG.error("Failed to initialized service assembly: " + assemblyName, e);
+ LOGGER.error("Failed to initialized service assembly: {}", assemblyName, e);
}
}
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java Thu Jul 21 13:03:53 2011
@@ -33,8 +33,6 @@ import javax.management.MBeanOperationIn
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.container.ComponentEnvironment;
import org.apache.servicemix.jbi.container.EnvironmentContext;
import org.apache.servicemix.jbi.container.JBIContainer;
@@ -48,6 +46,8 @@ import org.apache.servicemix.jbi.managem
import org.apache.servicemix.jbi.management.ParameterHelper;
import org.apache.servicemix.jbi.util.FileUtil;
import org.apache.servicemix.jbi.util.FileVersionUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Installation Service - installs/uninstalls archives
@@ -56,7 +56,7 @@ import org.apache.servicemix.jbi.util.Fi
*/
public class InstallationService extends BaseSystemService implements InstallationServiceMBean {
- private static final Log LOG = LogFactory.getLog(InstallationService.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(InstallationService.class);
private EnvironmentContext environmentContext;
@@ -88,9 +88,7 @@ public class InstallationService extends
public synchronized ObjectName loadNewInstaller(String installJarURL) {
try {
ObjectName result = null;
- if (LOG.isDebugEnabled()) {
- LOG.debug("Loading new installer from " + installJarURL);
- }
+ LOGGER.debug("Loading new installer from {}", installJarURL);
File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), installJarURL);
if (tmpDir != null) {
Descriptor root = DescriptorFactory.buildDescriptor(tmpDir);
@@ -113,7 +111,7 @@ public class InstallationService extends
}
return result;
} catch (Throwable t) {
- LOG.error("Deployment failed", t);
+ LOGGER.error("Deployment failed", t);
if (t instanceof Error) {
throw (Error) t;
}
@@ -192,7 +190,7 @@ public class InstallationService extends
}
} catch (JBIException e) {
String errStr = "Problem shutting down Component: " + componentName;
- LOG.error(errStr, e);
+ LOGGER.error(errStr, e);
}
return result;
}
@@ -223,7 +221,7 @@ public class InstallationService extends
throw new DeploymentException("Could not find JBI descriptor");
}
} catch (DeploymentException e) {
- LOG.error("Deployment failed", e);
+ LOGGER.error("Deployment failed", e);
}
return result;
}
@@ -306,7 +304,7 @@ public class InstallationService extends
if (props != null && props.size() > 0) {
ObjectName on = installer.getInstallerConfigurationMBean();
if (on == null) {
- LOG.warn("Could not find installation configuration MBean. Installation properties will be ignored.");
+ LOGGER.warn("Could not find installation configuration MBean. Installation properties will be ignored.");
} else {
MBeanServer mbs = managementContext.getMBeanServer();
for (Iterator it = props.keySet().iterator(); it.hasNext();) {
@@ -330,11 +328,11 @@ public class InstallationService extends
if (lcc != null) {
lcc.start();
} else {
- LOG.warn("No ComponentConnector found for Component " + componentName);
+ LOGGER.warn("No ComponentConnector found for Component {}", componentName);
}
} catch (JBIException e) {
String errStr = "Failed to start Component: " + componentName;
- LOG.error(errStr, e);
+ LOGGER.error(errStr, e);
throw new DeploymentException(e);
}
}
@@ -390,12 +388,10 @@ public class InstallationService extends
if (!tmpDirectory.renameTo(installationDir)) {
throw new DeploymentException("Unable to rename " + tmpDirectory + " to " + installationDir);
}
- if (LOG.isDebugEnabled()) {
- LOG.debug("Moved " + tmpDirectory + " to " + installationDir);
- }
+ LOGGER.debug("Moved {} to {}", tmpDirectory, installationDir);
container.getRegistry().registerSharedLibrary(descriptor, installationDir);
} catch (Exception e) {
- LOG.error("Deployment of Shared Library failed", e);
+ LOGGER.error("Deployment of Shared Library failed", e);
// remove any files created for installation
FileUtil.deleteFile(installationDir);
throw new DeploymentException(e);
@@ -414,15 +410,13 @@ public class InstallationService extends
File oldInstallationDir = environmentContext.getComponentInstallationDir(name);
// try and delete the old version ? - maybe should leave around ??
if (!FileUtil.deleteFile(oldInstallationDir)) {
- LOG.warn("Failed to delete old installation directory: " + oldInstallationDir.getPath());
+ LOGGER.warn("Failed to delete old installation directory: {}", oldInstallationDir.getPath());
}
File componentRoot = environmentContext.createComponentRootDir(name);
// this will get the new one
File installationDir = environmentContext.getNewComponentInstallationDir(name);
tmpDirectory.renameTo(installationDir);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Moved " + tmpDirectory + " to " + installationDir);
- }
+ LOGGER.debug("Moved {} to {}", tmpDirectory, installationDir);
result = initializeInstaller(installationDir, componentRoot, descriptor);
return result;
} catch (IOException e) {
@@ -447,7 +441,7 @@ public class InstallationService extends
result.setObjectName(objectName);
managementContext.registerMBean(objectName, result, InstallerMBean.class, "standard installation controls for a Component");
} catch (Throwable e) {
- LOG.error("Deployment of Component failed", e);
+ LOGGER.error("Deployment of Component failed", e);
// remove any files created for installation
environmentContext.removeComponentRootDirectory(descriptor.getIdentification().getName());
throw new DeploymentException(e);
@@ -497,7 +491,7 @@ public class InstallationService extends
try {
container.getRegistry().registerSharedLibrary(sl, dir);
} catch (Exception e) {
- LOG.error("Failed to initialize sharted library", e);
+ LOGGER.error("Failed to initialize sharted library", e);
}
}
}
@@ -520,8 +514,8 @@ public class InstallationService extends
try {
buildComponent(directory);
} catch (DeploymentException e) {
- LOG.error("Could not build Component: " + directory.getName(), e);
- LOG.warn("Deleting Component directory: " + directory);
+ LOGGER.error("Could not build Component: {}", directory.getName(), e);
+ LOGGER.warn("Deleting Component directory: {}", directory);
FileUtil.deleteFile(directory);
}
}
@@ -544,7 +538,7 @@ public class InstallationService extends
nonLoadedInstallers.put(componentName, installer);
}
} catch (Throwable e) {
- LOG.error("Failed to deploy component: " + componentDirectory.getName(), e);
+ LOGGER.error("Failed to deploy component: {}", componentDirectory.getName(), e);
throw new DeploymentException(e);
}
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java Thu Jul 21 13:03:53 2011
@@ -31,11 +31,11 @@ import javax.management.InstanceNotFound
import javax.management.MBeanRegistrationException;
import javax.management.ObjectName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.xbean.classloader.DestroyableClassLoader;
import org.apache.xbean.classloader.JarFileClassLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* InstallerMBean defines standard installation and uninstallation controls for Binding Components and Service Engines.
@@ -45,7 +45,7 @@ import org.apache.xbean.classloader.JarF
*/
public class InstallerMBeanImpl implements InstallerMBean {
- private static final Log LOG = LogFactory.getLog(InstallerMBeanImpl.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(InstallerMBeanImpl.class);
private InstallationContextImpl context;
private JBIContainer container;
@@ -91,7 +91,7 @@ public class InstallerMBeanImpl implemen
initialized = true;
}
} catch (JBIException e) {
- LOG.error("Could not initialize bootstrap", e);
+ LOGGER.error("Could not initialize bootstrap", e);
throw new DeploymentException(e);
}
}
@@ -100,7 +100,7 @@ public class InstallerMBeanImpl implemen
try {
bootstrap.cleanUp();
} catch (JBIException e) {
- LOG.error("Could not initialize bootstrap", e);
+ LOGGER.error("Could not initialize bootstrap", e);
throw new DeploymentException(e);
} finally {
initialized = false;
@@ -120,16 +120,16 @@ public class InstallerMBeanImpl implemen
Class bootstrapClass = cl.loadClass(descriptor.getBootstrapClassName());
return (Bootstrap) bootstrapClass.newInstance();
} catch (MalformedURLException e) {
- LOG.error("Could not create class loader", e);
+ LOGGER.error("Could not create class loader", e);
throw new DeploymentException(e);
} catch (ClassNotFoundException e) {
- LOG.error("Class not found: " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Class not found: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (InstantiationException e) {
- LOG.error("Could not instantiate : " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Could not instantiate: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (IllegalAccessException e) {
- LOG.error("Illegal access on: " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Illegal access on: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} finally {
Thread.currentThread().setContextClassLoader(oldCl);
@@ -194,22 +194,22 @@ public class InstallerMBeanImpl implemen
context.isEngine(),
context.getSharedLibraries());
} catch (MalformedURLException e) {
- LOG.error("Could not create class loader", e);
+ LOGGER.error("Could not create class loader", e);
throw new DeploymentException(e);
} catch (NoClassDefFoundError e) {
- LOG.error("Class not found: " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Class not found: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (ClassNotFoundException e) {
- LOG.error("Class not found: " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Class not found: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (InstantiationException e) {
- LOG.error("Could not instantiate : " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Could not instantiate: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (IllegalAccessException e) {
- LOG.error("Illegal access on: " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Illegal access on: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} catch (JBIException e) {
- LOG.error("Could not initialize : " + descriptor.getBootstrapClassName(), e);
+ LOGGER.error("Could not initialize: {}", descriptor.getBootstrapClassName(), e);
throw new DeploymentException(e);
} finally {
Thread.currentThread().setContextClassLoader(oldCl);
@@ -319,9 +319,8 @@ public class InstallerMBeanImpl implemen
for (int i = 0; i < classPathNames.length; i++) {
File file = new File(dir, classPathNames[i]);
if (!file.exists()) {
- LOG.warn("Unable to add File " + file
- + " to class path as it doesn't exist: "
- + file.getAbsolutePath());
+ LOGGER.warn("Unable to add File {} to class path as it doesn't exist: {}",
+ file, file.getAbsolutePath());
}
urls.add(file.toURL());
}
@@ -333,9 +332,7 @@ public class InstallerMBeanImpl implemen
!parentFirst,
new String[0],
new String[] {"java.", "javax." });
- if (LOG.isDebugEnabled()) {
- LOG.debug("Component class loader: " + cl);
- }
+ LOGGER.debug("Component class loader: {}", cl);
return cl;
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java Thu Jul 21 13:03:53 2011
@@ -40,8 +40,6 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.executors.Executor;
import org.apache.servicemix.jbi.container.ActivationSpec;
import org.apache.servicemix.jbi.container.EnvironmentContext;
@@ -61,6 +59,9 @@ import org.apache.servicemix.jbi.service
import org.apache.servicemix.jbi.util.DOMUtil;
import org.apache.servicemix.jbi.util.WSAddressingConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Registry - state infomation including running state, SA's deployed etc.
*
@@ -68,7 +69,7 @@ import org.apache.servicemix.jbi.util.WS
*/
public class Registry extends BaseSystemService implements RegistryMBean {
- private static final Log LOG = LogFactory.getLog(Registry.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(Registry.class);
private ComponentRegistry componentRegistry;
private EndpointRegistry endpointRegistry;
@@ -385,13 +386,13 @@ public class Registry extends BaseSystem
}
}
} catch (Exception e) {
- LOG.debug("Unable to resolve EPR: " + e);
+ LOGGER.debug("Unable to resolve EPR: " + e);
}
return null;
}
/**
- * @param provider
+ * @param cns
* @param externalEndpoint the external endpoint to be registered, must be non-null.
* @throws JBIException
*/
@@ -402,7 +403,7 @@ public class Registry extends BaseSystem
}
/**
- * @param provider
+ * @param cns
* @param externalEndpoint the external endpoint to be deregistered; must be non-null.
*/
public void deregisterExternalEndpoint(ComponentNameSpace cns, ServiceEndpoint externalEndpoint) {
@@ -452,7 +453,6 @@ public class Registry extends BaseSystem
* @param name
* @param description
* @param component
- * @param dc
* @param binding
* @param service
* @return ComponentConnector
@@ -648,7 +648,7 @@ public class Registry extends BaseSystem
/**
* Get a named ServiceAssembly
- * @param name
+ * @param saName
* @return the ServiceAssembly or null if it doesn't exist
*/
public ServiceAssemblyLifeCycle getServiceAssembly(String saName) {
@@ -740,7 +740,7 @@ public class Registry extends BaseSystem
* Register a ServiceUnit.
*
* @param su the service unit to register
- * @param serviceAssembly the service assembly the service unit belongs to
+ * @param saName the service assembly the service unit belongs to
* @return the service unit key
*/
public String registerServiceUnit(ServiceUnit su, String saName, File suDir) {
@@ -754,7 +754,7 @@ public class Registry extends BaseSystem
ObjectName objectName = getContainer().getManagementContext().createObjectName(sulc);
getContainer().getManagementContext().registerMBean(objectName, sulc, ServiceUnitMBean.class);
} catch (JMException e) {
- LOG.error("Could not register MBean for service unit", e);
+ LOGGER.error("Could not register MBean for service unit", e);
}
return sulc.getKey();
}
@@ -770,7 +770,7 @@ public class Registry extends BaseSystem
try {
getContainer().getManagementContext().unregisterMBean(sulc);
} catch (JBIException e) {
- LOG.error("Could not unregister MBean for service unit", e);
+ LOGGER.error("Could not unregister MBean for service unit", e);
}
}
}
@@ -783,7 +783,7 @@ public class Registry extends BaseSystem
ObjectName objectName = getContainer().getManagementContext().createObjectName(library);
getContainer().getManagementContext().registerMBean(objectName, library, SharedLibraryMBean.class);
} catch (JMException e) {
- LOG.error("Could not register MBean for service unit", e);
+ LOGGER.error("Could not register MBean for service unit", e);
}
checkPendingComponents();
}
@@ -797,7 +797,7 @@ public class Registry extends BaseSystem
getContainer().getManagementContext().unregisterMBean(sl);
sl.dispose();
} catch (JBIException e) {
- LOG.error("Could not unregister MBean for shared library", e);
+ LOGGER.error("Could not unregister MBean for shared library", e);
}
}
}
@@ -864,7 +864,7 @@ public class Registry extends BaseSystem
sa.restore();
pendingAssemblies.remove(sa);
} catch (Exception e) {
- LOG.error("Error trying to restore service assembly state", e);
+ LOGGER.error("Error trying to restore service assembly state", e);
}
}
}
@@ -957,4 +957,5 @@ public class Registry extends BaseSystem
}
}
}
+
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java Thu Jul 21 13:03:53 2011
@@ -43,8 +43,6 @@ import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
import org.apache.servicemix.jbi.deployment.Connection;
import org.apache.servicemix.jbi.deployment.Consumes;
@@ -58,6 +56,9 @@ import org.apache.servicemix.jbi.managem
import org.apache.servicemix.jbi.management.OperationInfoHelper;
import org.apache.servicemix.jbi.util.XmlPersistenceSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* ComponentConnector is used internally for message routing
*
@@ -65,7 +66,7 @@ import org.apache.servicemix.jbi.util.Xm
*/
public class ServiceAssemblyLifeCycle implements ServiceAssemblyMBean, MBeanInfoProvider {
- private static final Log LOG = LogFactory.getLog(ServiceAssemblyLifeCycle.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(ServiceAssemblyLifeCycle.class);
private ServiceAssembly serviceAssembly;
@@ -83,7 +84,8 @@ public class ServiceAssemblyLifeCycle im
* Construct a LifeCycle
*
* @param sa
- * @param stateFile
+ * @param env
+ * @param registry
*/
public ServiceAssemblyLifeCycle(ServiceAssembly sa,
ServiceAssemblyEnvironment env,
@@ -104,7 +106,7 @@ public class ServiceAssemblyLifeCycle im
* @throws Exception
*/
public synchronized String init() throws Exception {
- LOG.info("Initializing service assembly: " + getName());
+ LOGGER.info("Initializing service assembly: {}", getName());
// Init service units
List<Element> componentFailures = new ArrayList<Element>();
for (int i = 0; i < sus.length; i++) {
@@ -130,7 +132,7 @@ public class ServiceAssemblyLifeCycle im
}
public synchronized String start(boolean writeState) throws Exception {
- LOG.info("Starting service assembly: " + getName());
+ LOGGER.info("Starting service assembly: {}", getName());
// Start connections
try {
startConnections();
@@ -180,7 +182,7 @@ public class ServiceAssemblyLifeCycle im
}
public synchronized String stop(boolean writeState, boolean forceInit) throws Exception {
- LOG.info("Stopping service assembly: " + getName());
+ LOGGER.info("Stopping service assembly: {}", getName());
// Stop connections
stopConnections();
// Stop service units
@@ -226,7 +228,7 @@ public class ServiceAssemblyLifeCycle im
}
public synchronized String shutDown(boolean writeState) throws Exception {
- LOG.info("Shutting down service assembly: " + getName());
+ LOGGER.info("Shutting down service assembly: {}", getName());
if (currentState != STOPPED) {
this.stop(writeState, false);
}
@@ -326,7 +328,7 @@ public class ServiceAssemblyLifeCycle im
XmlPersistenceSupport.write(env.getStateFile(), props);
}
} catch (IOException e) {
- LOG.error("Failed to write current running state for ServiceAssembly: " + getName(), e);
+ LOGGER.error("Failed to write current running state for ServiceAssembly: {}", getName(), e);
}
}
@@ -340,7 +342,7 @@ public class ServiceAssemblyLifeCycle im
return props.getProperty("state", SHUTDOWN);
}
} catch (Exception e) {
- LOG.error("Failed to read current running state for ServiceAssembly: " + getName(), e);
+ LOGGER.error("Failed to read current running state for ServiceAssembly: {}", getName(), e);
}
return null;
}
@@ -438,7 +440,7 @@ public class ServiceAssemblyLifeCycle im
Document doc = parse(resultMsg);
result = getElement(doc, "component-task-result");
} catch (Exception e) {
- LOG.warn("Could not parse result exception", e);
+ LOGGER.warn("Could not parse result exception", e);
}
if (result == null) {
result = ManagementSupport.createComponentFailure(
@@ -535,7 +537,6 @@ public class ServiceAssemblyLifeCycle im
break;
}
}
-
}
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/AdminReadWritePolicy.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/AdminReadWritePolicy.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/AdminReadWritePolicy.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/AdminReadWritePolicy.java Thu Jul 21 13:03:53 2011
@@ -20,9 +20,9 @@ import java.lang.reflect.Method;
import java.security.Principal;
import javax.security.auth.Subject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.GroupPrincipal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Policy implementation that grants read-write access to members of the 'admin' group
@@ -32,7 +32,8 @@ import org.apache.servicemix.jbi.securit
*/
public class AdminReadWritePolicy extends Policy {
- private static final Log LOG = LogFactory.getLog(AdminReadWritePolicy.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(AdminReadWritePolicy.class);
+
private static final String INVOKE = "invoke";
/**
@@ -43,7 +44,7 @@ public class AdminReadWritePolicy extend
if (isReadOnly(method) || isAdmin(subject) || isInvokeReadOnly(method, args)) {
// allow the method invocation
} else {
- LOG.warn(String.format("Denied access to MBeanServer.%s(%s) to %s",
+ LOGGER.warn(String.format("Denied access to MBeanServer.%s(%s) to %s",
method.getName(), explode(args), subject));
throw new SecurityException("Not authorized to run MBeanServer." + method.getName()
+ "\n(" + explode(args) + ")");
@@ -92,4 +93,5 @@ public class AdminReadWritePolicy extend
public String toString() {
return "admin group read-write access";
}
+
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/ConnectorServerFactoryBean.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/ConnectorServerFactoryBean.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/ConnectorServerFactoryBean.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jmx/ConnectorServerFactoryBean.java Thu Jul 21 13:03:53 2011
@@ -26,8 +26,8 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.security.auth.Subject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -44,8 +44,7 @@ import org.springframework.jmx.support.J
*
* This xbean-enabled factory is a wrapper on top of the existing Spring
* factory bean. It also logs the serviceUrl when starting.
- *
- * @author gnodet
+ *
* @org.apache.xbean.XBean element="jmxConnector"
*/
public class ConnectorServerFactoryBean implements FactoryBean, InitializingBean, DisposableBean {
@@ -71,7 +70,8 @@ public class ConnectorServerFactoryBean
private static final Constants CONSTANTS = new Constants(ConnectorServerFactoryBean.class);
- private Log log = LogFactory.getLog(ConnectorServerFactoryBean.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(ConnectorServerFactoryBean.class);
+
private org.springframework.jmx.support.ConnectorServerFactoryBean csfb =
new org.springframework.jmx.support.ConnectorServerFactoryBean();
private String serviceUrl = org.springframework.jmx.support.ConnectorServerFactoryBean.DEFAULT_SERVICE_URL;
@@ -109,7 +109,6 @@ public class ConnectorServerFactoryBean
* itself with the <code>MBeanServer</code>.
* @param objectName
* @throws MalformedObjectNameException if the <code>ObjectName</code> is malformed
- * @see org.springframework.jmx.support.ConnectorServerFactoryBean#setObjectName(java.lang.String)
*/
public void setObjectName(String objectName) throws MalformedObjectNameException {
this.objectName = objectName;
@@ -205,7 +204,7 @@ public class ConnectorServerFactoryBean
MBeanServer mbs = server;
if (policy != null) {
- log.info("Configuring JMX authorization policy: " + policy);
+ LOGGER.info("Configuring JMX authorization policy: {}", policy);
if (mbs == null) {
mbs = createProxyForPolicy(JmxUtils.locateMBeanServer());
} else {
@@ -215,7 +214,7 @@ public class ConnectorServerFactoryBean
csfb.setServer(mbs);
csfb.afterPropertiesSet();
- log.info("JMX connector available at: " + serviceUrl);
+ LOGGER.info("JMX connector available at: {}", serviceUrl);
}
private MBeanServer createProxyForPolicy(final MBeanServer mbs) {
@@ -264,4 +263,5 @@ public class ConnectorServerFactoryBean
}
}
}
+
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java Thu Jul 21 13:03:53 2011
@@ -25,20 +25,19 @@ import javax.jbi.messaging.MessageExchan
import javax.jbi.servicedesc.ServiceEndpoint;
import javax.security.auth.Subject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
import org.apache.servicemix.jbi.nmr.DefaultBroker;
import org.apache.servicemix.jbi.security.acl.AuthorizationMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- *
- * @author gnodet
* @org.apache.xbean.XBean
*/
public class SecuredBroker extends DefaultBroker {
- private static final Log LOG = LogFactory.getLog(SecuredBroker.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(SecuredBroker.class);
+
private AuthorizationMap authorizationMap;
public SecuredBroker() {
@@ -63,7 +62,7 @@ public class SecuredBroker extends Defau
}
public void sendExchangePacket(MessageExchange me) throws JBIException {
- LOG.debug("send exchange with secure broker");
+ LOGGER.debug("send exchange with secure broker");
MessageExchangeImpl exchange = (MessageExchangeImpl) me;
if (exchange.getRole() == Role.PROVIDER) {
checkSecurity(exchange);
@@ -77,15 +76,15 @@ public class SecuredBroker extends Defau
}
ServiceEndpoint se = exchange.getEndpoint();
if (se != null) {
- LOG.debug("service name :" + se.getServiceName());
- LOG.debug("operation name :" + exchange.getOperation());
+ LOGGER.debug("service name: {}", se.getServiceName());
+ LOGGER.debug("operation name: {}", exchange.getOperation());
Set<Principal> acls = authorizationMap.getAcls(se, exchange.getOperation());
if (!acls.contains(GroupPrincipal.ANY)) {
Subject subject = exchange.getMessage("in").getSecuritySubject();
if (subject == null) {
throw new SecurityException("User not authenticated");
}
- LOG.debug("authorization for " + subject);
+ LOGGER.debug("authorization for {}", subject);
acls.retainAll(subject.getPrincipals());
if (acls.size() == 0) {
throw new SecurityException("Endpoint is not authorized for this user");
@@ -93,4 +92,5 @@ public class SecuredBroker extends Defau
}
}
}
+
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/auth/impl/JAASAuthenticationService.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/auth/impl/JAASAuthenticationService.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/auth/impl/JAASAuthenticationService.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/auth/impl/JAASAuthenticationService.java Thu Jul 21 13:03:53 2011
@@ -28,10 +28,10 @@ import javax.security.auth.callback.Pass
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.LoginContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.auth.AuthenticationService;
import org.apache.servicemix.jbi.security.login.CertificateCallback;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Implementation of the authentication service using JAAS.
@@ -40,15 +40,13 @@ import org.apache.servicemix.jbi.securit
*/
public class JAASAuthenticationService implements AuthenticationService {
- private static final Log LOG = LogFactory.getLog(JAASAuthenticationService.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(JAASAuthenticationService.class);
public void authenticate(Subject subject,
String domain,
final String user,
final Object credentials) throws GeneralSecurityException {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Authenticating '" + user);
- }
+ LOGGER.debug("Authenticating {}", user);
LoginContext loginContext = new LoginContext(domain, subject, new CallbackHandler() {
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
@@ -68,13 +66,9 @@ public class JAASAuthenticationService i
});
try {
loginContext.login();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Authenticating " + user + " successfully");
- }
+ LOGGER.debug("Authenticating {} successfully", user);
} catch (GeneralSecurityException e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Error authenticating " + user, e);
- }
+ LOGGER.debug("Error authenticating {}", user, e);
throw e;
}
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/BaseKeystoreManager.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/BaseKeystoreManager.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/BaseKeystoreManager.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/BaseKeystoreManager.java Thu Jul 21 13:03:53 2011
@@ -23,20 +23,18 @@ import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocketFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.keystore.KeystoreInstance;
import org.apache.servicemix.jbi.security.keystore.KeystoreIsLocked;
import org.apache.servicemix.jbi.security.keystore.KeystoreManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- *
* @org.apache.xbean.XBean element="keystoreManager"
- *
*/
public class BaseKeystoreManager implements KeystoreManager {
- protected final Log log = LogFactory.getLog(getClass());
+ protected static final transient Logger LOGGER = LoggerFactory.getLogger(BaseKeystoreManager.class);
protected KeystoreInstance[] keystores;
@@ -75,22 +73,12 @@ public class BaseKeystoreManager impleme
* The trust keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must have unlocked this
* key.
- * @param loader
- * The class loader used to resolve factory classes.
*
* @return A created SSLSocketFactory item created from the KeystoreManager.
* @throws GeneralSecurityException
* @throws KeystoreIsLocked
* Occurs when the requested key keystore cannot be used because
* it has not been unlocked.
- * @throws KeyIsLocked
- * Occurs when the requested private key in the key keystore
- * cannot be used because it has not been unlocked.
- * @throws NoSuchAlgorithmException
- * @throws UnrecoverableKeyException
- * @throws KeyStoreException
- * @throws KeyManagementException
- * @throws NoSuchProviderException
*/
public SSLSocketFactory createSSLFactory(String provider, String protocol,
String algorithm, String keyStore,
@@ -143,7 +131,7 @@ public class BaseKeystoreManager impleme
new SecureRandom());
return context.getSocketFactory();
} catch (Exception e) {
- log.error("Unable to dynamically load", e);
+ LOGGER.error("Unable to dynamically load", e);
return null;
}
}
@@ -169,15 +157,10 @@ public class BaseKeystoreManager impleme
* The trust keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must have unlocked this
* key.
- * @param loader
- * The class loader used to resolve factory classes.
*
* @throws KeystoreIsLocked
* Occurs when the requested key keystore cannot be used because
* it has not been unlocked.
- * @throws KeyIsLocked
- * Occurs when the requested private key in the key keystore
- * cannot be used because it has not been unlocked.
*/
public SSLServerSocketFactory createSSLServerFactory(String provider, String protocol,
String algorithm, String keyStore,
@@ -226,7 +209,7 @@ public class BaseKeystoreManager impleme
new SecureRandom());
return context.getServerSocketFactory();
} catch (Exception e) {
- log.error("Unable to dynamically load", e);
+ LOGGER.error("Unable to dynamically load", e);
return null;
}
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/FileKeystoreInstance.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/FileKeystoreInstance.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/FileKeystoreInstance.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/keystore/impl/FileKeystoreInstance.java Thu Jul 21 13:03:53 2011
@@ -40,19 +40,19 @@ import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.keystore.KeystoreInstance;
import org.apache.servicemix.jbi.security.keystore.KeystoreIsLocked;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
/**
- *
* @org.apache.xbean.XBean element="keystore"
*/
public class FileKeystoreInstance implements KeystoreInstance {
- private static final Log LOG = LogFactory.getLog(FileKeystoreInstance.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(FileKeystoreInstance.class);
+
private static final String JKS = "JKS";
private Resource path;
@@ -124,7 +124,7 @@ public class FileKeystoreInstance implem
try {
return keystore.getCertificate(alias);
} catch (KeyStoreException e) {
- LOG.error("Unable to read certificate from keystore", e);
+ LOGGER.error("Unable to read certificate from keystore", e);
}
return null;
}
@@ -136,7 +136,7 @@ public class FileKeystoreInstance implem
try {
return keystore.getCertificateAlias(cert);
} catch (KeyStoreException e) {
- LOG.error("Unable to read retrieve alias for given certificate from keystore", e);
+ LOGGER.error("Unable to read retrieve alias for given certificate from keystore", e);
}
return null;
}
@@ -148,7 +148,7 @@ public class FileKeystoreInstance implem
try {
return keystore.getCertificateChain(alias);
} catch (KeyStoreException e) {
- LOG.error("Unable to read certificate chain from keystore", e);
+ LOGGER.error("Unable to read certificate chain from keystore", e);
}
return null;
}
@@ -179,11 +179,11 @@ public class FileKeystoreInstance implem
return (PrivateKey) key;
}
} catch (KeyStoreException e) {
- LOG.error("Unable to read private key from keystore", e);
+ LOGGER.error("Unable to read private key from keystore", e);
} catch (NoSuchAlgorithmException e) {
- LOG.error("Unable to read private key from keystore", e);
+ LOGGER.error("Unable to read private key from keystore", e);
} catch (UnrecoverableKeyException e) {
- LOG.error("Unable to read private key from keystore", e);
+ LOGGER.error("Unable to read private key from keystore", e);
}
return null;
}
@@ -256,13 +256,13 @@ public class FileKeystoreInstance implem
}
return true;
} catch (KeyStoreException e) {
- LOG.error("Unable to open keystore with provided password", e);
+ LOGGER.error("Unable to open keystore with provided password", e);
} catch (IOException e) {
- LOG.error("Unable to open keystore with provided password", e);
+ LOGGER.error("Unable to open keystore with provided password", e);
} catch (NoSuchAlgorithmException e) {
- LOG.error("Unable to open keystore with provided password", e);
+ LOGGER.error("Unable to open keystore with provided password", e);
} catch (CertificateException e) {
- LOG.error("Unable to open keystore with provided password", e);
+ LOGGER.error("Unable to open keystore with provided password", e);
}
return false;
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/CertificatesLoginModule.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/CertificatesLoginModule.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/CertificatesLoginModule.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/CertificatesLoginModule.java Thu Jul 21 13:03:53 2011
@@ -35,22 +35,21 @@ import javax.security.auth.login.FailedL
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.GroupPrincipal;
import org.apache.servicemix.jbi.security.UserPrincipal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This login module authenticate users given an X509 certificate.
- *
*/
public class CertificatesLoginModule implements LoginModule {
private static final String USER_FILE = "org.apache.servicemix.security.certificates.user";
private static final String GROUP_FILE = "org.apache.servicemix.security.certificates.group";
- private static final Log LOG = LogFactory.getLog(CertificatesLoginModule.class);
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(CertificatesLoginModule.class);
private Subject subject;
private CallbackHandler callbackHandler;
@@ -78,7 +77,7 @@ public class CertificatesLoginModule imp
groupsFile = (String) options.get(GROUP_FILE) + "";
if (debug) {
- LOG.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile
+ LOGGER.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile
+ " basedir=" + baseDir);
}
}
@@ -119,7 +118,7 @@ public class CertificatesLoginModule imp
user = (String) entry.getKey();
principals.add(principal);
if (debug) {
- LOG.debug("login " + user);
+ LOGGER.debug("login {}", user);
}
return true;
}
@@ -146,7 +145,7 @@ public class CertificatesLoginModule imp
clear();
if (debug) {
- LOG.debug("commit");
+ LOGGER.debug("commit");
}
return true;
}
@@ -155,7 +154,7 @@ public class CertificatesLoginModule imp
clear();
if (debug) {
- LOG.debug("abort");
+ LOGGER.debug("abort");
}
return true;
}
@@ -165,7 +164,7 @@ public class CertificatesLoginModule imp
principals.clear();
if (debug) {
- LOG.debug("logout");
+ LOGGER.debug("logout");
}
return true;
}
@@ -174,4 +173,5 @@ public class CertificatesLoginModule imp
groups.clear();
user = null;
}
+
}
Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/PropertiesLoginModule.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/PropertiesLoginModule.java?rev=1149154&r1=1149153&r2=1149154&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/PropertiesLoginModule.java (original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/login/PropertiesLoginModule.java Thu Jul 21 13:03:53 2011
@@ -34,10 +34,10 @@ import javax.security.auth.login.FailedL
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.security.GroupPrincipal;
import org.apache.servicemix.jbi.security.UserPrincipal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* JAAS Login module for user / password, based on two properties files.
@@ -47,7 +47,8 @@ public class PropertiesLoginModule imple
private static final String USER_FILE = "org.apache.servicemix.security.properties.user";
private static final String GROUP_FILE = "org.apache.servicemix.security.properties.group";
- private static final Log LOG = LogFactory.getLog(PropertiesLoginModule.class);
+
+ private static final transient Logger LOGGER = LoggerFactory.getLogger(PropertiesLoginModule.class);
private Subject subject;
private CallbackHandler callbackHandler;
@@ -75,7 +76,7 @@ public class PropertiesLoginModule imple
groupsFile = (String) options.get(GROUP_FILE) + "";
if (debug) {
- LOG.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile + " basedir=" + baseDir);
+ LOGGER.debug("Initialized debug=" + debug + " usersFile=" + usersFile + " groupsFile=" + groupsFile + " basedir=" + baseDir);
}
}
@@ -122,7 +123,7 @@ public class PropertiesLoginModule imple
users.clear();
if (debug) {
- LOG.debug("login " + user);
+ LOGGER.debug("login {}", user);
}
return true;
}
@@ -146,7 +147,7 @@ public class PropertiesLoginModule imple
clear();
if (debug) {
- LOG.debug("commit");
+ LOGGER.debug("commit");
}
return true;
}
@@ -155,7 +156,7 @@ public class PropertiesLoginModule imple
clear();
if (debug) {
- LOG.debug("abort");
+ LOGGER.debug("abort");
}
return true;
}
@@ -165,7 +166,7 @@ public class PropertiesLoginModule imple
principals.clear();
if (debug) {
- LOG.debug("logout");
+ LOGGER.debug("logout");
}
return true;
}
@@ -174,4 +175,5 @@ public class PropertiesLoginModule imple
groups.clear();
user = null;
}
+
}