HHH-8721 CoreMessageLogger conflicts

This commit is contained in:
Brett Meyer 2013-11-19 18:09:28 -05:00
parent 8580b29161
commit 834a71bc6d
3 changed files with 17 additions and 6 deletions

View File

@ -1645,5 +1645,13 @@ public interface CoreMessageLogger extends BasicLogger {
"delaying afterCompletion processing until the original thread can handle it. [status=%s]"
)
void rollbackFromBackgroundThread(int status);
@LogMessage(level = WARN)
@Message(value = "Exception while loading a class or resource found during scanning", id = 452)
void unableToLoadScannedClassOrResource(@Cause Exception e);
@LogMessage(level = WARN)
@Message(value = "Exception while discovering OSGi service implementations : %s", id = 453)
void unableToDiscoverOsgiService(String service, @Cause Exception e);
}

View File

@ -26,6 +26,8 @@ import java.util.Collection;
import javax.persistence.PersistenceException;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.jpa.boot.archive.spi.ArchiveContext;
import org.hibernate.jpa.boot.archive.spi.ArchiveDescriptor;
import org.hibernate.jpa.boot.archive.spi.ArchiveEntry;
@ -42,7 +44,7 @@ import org.osgi.framework.wiring.BundleWiring;
* @author Tim Ward
*/
public class OsgiArchiveDescriptor implements ArchiveDescriptor {
private static final Logger LOG = Logger.getLogger( OsgiArchiveDescriptor.class );
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( OsgiArchiveDescriptor.class );
private final Bundle persistenceBundle;
private final BundleWiring bundleWiring;
@ -115,7 +117,7 @@ public class OsgiArchiveDescriptor implements ArchiveDescriptor {
context.obtainArchiveEntryHandler( entry ).handleEntry( entry, context );
}
catch ( Exception e ) {
LOG.warn( "Exception while loading a class or resource found during scanning", e );
LOG.unableToLoadScannedClassOrResource( e );
}
}
}

View File

@ -22,7 +22,8 @@ package org.hibernate.osgi;
import java.lang.reflect.Array;
import org.jboss.logging.Logger;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
@ -32,7 +33,7 @@ import org.osgi.util.tracker.ServiceTracker;
* @author Brett Meyer
*/
public class OsgiServiceUtil {
private static final Logger LOG = Logger.getLogger( OsgiServiceUtil.class );
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( OsgiServiceUtil.class );
/**
* Locate all implementors of the given service contract in the given OSGi buindle context. Utilizes
@ -53,7 +54,7 @@ public class OsgiServiceUtil {
}
}
catch ( Exception e ) {
LOG.warnf( e, "Exception while discovering OSGi service implementations : %s", contract.getName() );
LOG.unableToDiscoverOsgiService( contract.getName(), e );
}
return (T[]) Array.newInstance(contract, 0);
}
@ -74,7 +75,7 @@ public class OsgiServiceUtil {
return (T) serviceTracker.waitForService( 1000 );
}
catch ( Exception e ) {
LOG.warnf( e, "Exception while discovering OSGi service implementations : %s", contract.getName() );
LOG.unableToDiscoverOsgiService( contract.getName(), e );
return null;
}
}