Skip to content

Commit

Permalink
WFLY-6941 Add WeldEjbLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Nov 21, 2016
1 parent afd3dea commit c1def21
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
Expand Up @@ -28,6 +28,10 @@
<property name="jboss.api" value="private"/>
</properties>

<exports>
<exclude path="org/jboss/as/weld/_private"/>
</exports>

<resources>
<artifact name="${org.wildfly:wildfly-weld-ejb}"/>
</resources>
Expand All @@ -38,6 +42,7 @@
<module name="org.jboss.weld.core" />
<module name="org.jboss.as.weld.spi" />
<module name="org.jboss.as.weld.common" />
<module name="org.jboss.logging"/>
<module name="org.jboss.as.server"/>
<module name="org.jboss.as.ee"/>
<module name="org.jboss.as.naming"/>
Expand Down
Expand Up @@ -28,10 +28,6 @@
<property name="jboss.api" value="private"/>
</properties>

<exports>
<exclude path="org/jboss/as/weld/logging"/>
</exports>

<resources>
<artifact name="${org.wildfly:wildfly-weld}"/>
</resources>
Expand Down
24 changes: 24 additions & 0 deletions weld/ejb/pom.xml
Expand Up @@ -29,6 +29,30 @@
<artifactId>wildfly-ejb3</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<!-- This is a compile-time dependency of this project, but is not
needed at compile or runtime by other projects that depend on this project. -->
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<!-- This is a compile-time dependency of this project, but is not
needed at compile or runtime by other projects that depend on this project. -->
<scope>provided</scope>
<optional>true</optional>
</dependency>


</dependencies>

</project>
@@ -0,0 +1,40 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2016, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

package org.jboss.as.weld._private;

import javax.ejb.NoSuchEJBException;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "WFLYWELDEJB", length = 4)
public interface WeldEjbLogger extends BasicLogger {

WeldEjbLogger ROOT_LOGGER = Logger.getMessageLogger(WeldEjbLogger.class, "org.jboss.as.weld.ejb");

@Message(id = 1, value = "EJB has been removed: %s")
NoSuchEJBException ejbHashBeenRemoved(Object ejbComponent);

}
Expand Up @@ -28,12 +28,11 @@
import java.util.HashMap;
import java.util.Map;

import javax.ejb.NoSuchEJBException;

import org.jboss.as.ee.component.ComponentView;
import org.jboss.as.ejb3.component.stateful.StatefulSessionComponent;
import org.jboss.as.naming.ManagedReference;
import org.jboss.as.server.CurrentServiceContainer;
import org.jboss.as.weld._private.WeldEjbLogger;
import org.jboss.as.weld.logging.WeldLogger;
import org.jboss.ejb.client.SessionID;
import org.jboss.msc.service.ServiceContainer;
Expand Down Expand Up @@ -79,8 +78,7 @@ public StatefulSessionObjectReferenceImpl(EjbDescriptorImpl<?> descriptor) {
@SuppressWarnings({ "unchecked" })
public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) {
if (isRemoved()) {
// Cannot be placed in WeldLogger
throw new NoSuchEJBException("EJB has been removed");
WeldEjbLogger.ROOT_LOGGER.ejbHashBeenRemoved(ejbComponent);
}

final String businessInterfaceName = businessInterfaceType.getName();
Expand Down

0 comments on commit c1def21

Please sign in to comment.