Skip to content

Commit

Permalink
[JBPAPP-8975] Update messages that were not previously ready for i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
jamezp committed Aug 15, 2012
1 parent c29fda9 commit 943a99d
Show file tree
Hide file tree
Showing 20 changed files with 165 additions and 114 deletions.
4 changes: 4 additions & 0 deletions ee/src/main/java/org/jboss/as/ee/EeLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,8 @@ public interface EeLogger extends BasicLogger {
@Message(id = 11012, value = "Injection for a member with static modifier is only acceptable on application clients, ignoring injection for target %s")
void ignoringStaticInjectionTarget(InjectionTarget injectionTarget);

@LogMessage(level = WARN)
@Message(id = 11013, value = "%s in subdeployment ignored. jboss-ejb-client.xml is only parsed for top level deployments.")
void subdeploymentIgnored(String pathName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package org.jboss.as.ee.structure;

import org.jboss.as.ee.EeLogger;
import org.jboss.as.ee.EeMessages;
import org.jboss.as.ee.metadata.EJBClientDescriptorMetaData;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
Expand Down Expand Up @@ -55,8 +56,6 @@
*/
public class EJBClientDescriptorParsingProcessor implements DeploymentUnitProcessor {

private static final Logger logger = Logger.getLogger(EJBClientDescriptorParsingProcessor.class);

public static final String[] EJB_CLIENT_DESCRIPTOR_LOCATIONS = {"META-INF/jboss-ejb-client.xml", "WEB-INF/jboss-ejb-client.xml"};


Expand Down Expand Up @@ -96,7 +95,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
return;
}
if (deploymentUnit.getParent() != null) {
logger.warnf("%s in subdeployment ignored. jboss-ejb-client.xml is only parsed for top level deployments.", descriptorFile.getPathName());
EeLogger.ROOT_LOGGER.subdeploymentIgnored(descriptorFile.getPathName());
return;
}
final File ejbClientDeploymentDescriptorFile;
Expand All @@ -106,7 +105,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
throw EeMessages.MESSAGES.failedToProcessEJBClientDescriptor(e);
}
final EJBClientDescriptorMetaData ejbClientDescriptorMetaData = parse(ejbClientDeploymentDescriptorFile, deploymentUnit, moduleLoader);
logger.debug("Successfully parsed jboss-ejb-client.xml for deployment unit " + deploymentUnit);
EeLogger.ROOT_LOGGER.debugf("Successfully parsed jboss-ejb-client.xml for deployment unit %s", deploymentUnit);
// attach the metadata
deploymentUnit.putAttachment(Attachments.EJB_CLIENT_METADATA, ejbClientDescriptorMetaData);
}
Expand Down
87 changes: 86 additions & 1 deletion ejb3/src/main/java/org/jboss/as/ejb3/EjbLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
import org.jboss.as.ejb3.component.entity.EntityBeanComponentInstance;
import org.jboss.as.ejb3.component.stateful.StatefulSessionComponentInstance;
import org.jboss.as.ejb3.deployment.DeploymentModuleIdentifier;
import org.jboss.as.ejb3.subsystem.deployment.InstalledComponent;
import org.jboss.as.ejb3.timerservice.TimerImpl;
import org.jboss.as.ejb3.tx.TimerTransactionRolledBackException;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.ejb.client.EJBLocator;
import org.jboss.ejb.client.SessionID;
import org.jboss.ejb.client.XidTransactionID;
import org.jboss.invocation.InterceptorContext;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
Expand All @@ -48,6 +50,7 @@
import org.jboss.logging.MessageLogger;
import org.jboss.logging.Param;
import org.jboss.remoting3.Channel;
import org.jboss.remoting3.MessageInputStream;

import javax.ejb.EJBException;
import javax.ejb.EJBTransactionRequiredException;
Expand All @@ -72,7 +75,7 @@
import static org.jboss.logging.Logger.Level.WARN;

/**
* This module is using message IDs in the range 14100-14599. This file is using the subset 14100-14149 for
* This module is using message IDs in the range 14100-14599. This file is using the subset 14100-14299 for
* logger messages. See http://community.jboss.org/docs/DOC-16810 for the full list of currently reserved
* JBAS message id blocks.
*
Expand Down Expand Up @@ -671,6 +674,10 @@ public interface EjbLogger extends BasicLogger {
@Message(id = 14213, value = "Could not send module availability notification of module %s on channel %s")
void failedToSendModuleAvailabilityMessageToClient(@Cause Exception e, DeploymentModuleIdentifier deploymentId, Channel channel);

@LogMessage(level = WARN)
@Message(id = Message.INHERIT, value = "Could not send initial module availability report to channel %s")
void failedToSendModuleAvailabilityMessageToClient(@Cause Exception e, Channel channel);

@LogMessage(level = WARN)
@Message(id = 14214, value = "Could not send module un-availability notification of module %s on channel %s")
void failedToSendModuleUnavailabilityMessageToClient(@Cause Exception e, DeploymentModuleIdentifier deploymentId, Channel channel);
Expand Down Expand Up @@ -715,6 +722,84 @@ public interface EjbLogger extends BasicLogger {
@Message(id = 14224, value = "Cannot add cluster node %s to cluster %s since none of the client mappings matched for address %s")
void cannotAddClusterNodeDueToUnresolvableClientMapping(final String nodeName, final String clusterName, final InetAddress bindAddress);

// Note that 14225-14240 is used in EjbMessages

@LogMessage(level = ERROR)
@Message(id = 14241, value = "Exception calling deployment added listener")
void deploymentAddListenerException(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14242, value = "Exception calling deployment removal listener")
void deploymentRemoveListenerException(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14243, value = "Failed to remove management resources for %s -- %s")
void failedToRemoveManagementResources(InstalledComponent component, String cause);

@LogMessage(level = INFO)
@Message(id = 14244, value = "CORBA interface repository for %s: %s")
void cobraInterfaceRepository(String repo, String object);

@LogMessage(level = ERROR)
@Message(id = 14245, value = "Cannot unregister EJBHome from CORBA naming service")
void cannotUnregisterEJBHomeFromCobra(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14246, value = "Cannot deactivate home servant")
void cannotDeactivateHomeServant(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14247, value = "Cannot deactivate bean servant")
void cannotDeactivateBeanServant(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14248, value = "Exception on channel %s from message %s")
void exceptionOnChannel(@Cause Throwable cause, Channel channel, MessageInputStream inputStream);

@LogMessage(level = ERROR)
@Message(id = 14249, value = "Error invoking method %s on bean named %s for appname %s modulename %s distinctname %s")
void errorInvokingMethod(@Cause Throwable cause, Method invokedMethod, String beanName, String appName, String moduleName, String distinctName);

@LogMessage(level = ERROR)
@Message(id = 14250, value = "Could not write method invocation failure for method %s on bean named %s for appname %s modulename %s distinctname %s due to")
void couldNotWriteMethodInvocation(@Cause Throwable cause, Method invokedMethod, String beanName, String appName, String moduleName, String distinctName);

@LogMessage(level = ERROR)
@Message(id = 14251, value = "IOException while generating session id for invocation id: %s on channel %s")
void exceptionGeneratingSessionId(@Cause Throwable cause, short invocationId, Channel channel);

@LogMessage(level = ERROR)
@Message(id = 14252, value = "Could not write out message to channel due to")
void couldNotWriteOutToChannel(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14253, value = "Could not write out invocation success message to channel due to")
void couldNotWriteInvocationSuccessMessage(@Cause Throwable cause);

@LogMessage(level = WARN)
@Message(id = 14254, value = "Received unsupported message header 0x%s on channel %s")
void unsupportedMessageHeader(String header, Channel channel);

@LogMessage(level = ERROR)
@Message(id = 14255, value = "Error during transaction management of transaction id %s")
void errorDuringTransactionManagement(@Cause Throwable cause, XidTransactionID id);

@LogMessage(level = WARN)
@Message(id = 14256, value = "%s retrying %d")
void retrying(String message, int count);

@LogMessage(level = ERROR)
@Message(id = 14257, value = "Failed to get status")
void failedToGetStatus(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14258, value = "Failed to rollback")
void failedToRollback(@Cause Throwable cause);

@LogMessage(level = ERROR)
@Message(id = 14259, value = "BMT stateful bean '%s' did not complete user transaction properly status=%s")
void transactionNotComplete(String componentName, String status);


// Don't add message ids greater that 14299!!! If you need more first check what EjbMessages is
// using and take more (lower) numbers from the available range for this module. If the range for the module is
Expand Down
8 changes: 7 additions & 1 deletion ejb3/src/main/java/org/jboss/as/ejb3/EjbMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,12 @@ public interface EjbMessages {
@Message(id = 14579, value = "EJB business method %s must be public")
DeploymentUnitProcessingException ejbBusinessMethodMustBePublic(final Method method);

@Message(id = 14580, value = "Unexpected Error")
EJBException unexpectedError();

@Message(id = 14581, value = "EJB 3.1 FR 13.3.3: BMT bean %s should complete transaction before returning.")
String transactionNotComplete(String componentName);

// STOP!!! Don't add message ids greater that 14599!!! If you need more first check what EjbLogger is
// using and take more (lower) numbers from the available range for this module. If the range for the module is
// all used, go to https://community.jboss.org/docs/DOC-16810 and allocate another block for this subsystem
Expand All @@ -2081,7 +2087,7 @@ public interface EjbMessages {
@Message(id = 14225, value = "Could not create an instance of deployment node selector %s")
DeploymentUnitProcessingException failedToCreateDeploymentNodeSelector(@Cause Exception e, String deploymentNodeSelectorClassName);

// Don't add exception messages greater that 14299!!! If you need more go to
// Don't add exception messages greater that 14240!!! If you need more go to
// https://community.jboss.org/docs/DOC-16810 and allocate another block for this subsystem

@Message(id = 14226, value = "Could not lookup service %s")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;
import java.util.Map;

import org.jboss.as.ejb3.EjbLogger;
import org.jboss.logging.Logger;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceName;
Expand All @@ -23,8 +24,6 @@ public class DeploymentRepository implements Service<DeploymentRepository> {

public static final ServiceName SERVICE_NAME = ServiceName.JBOSS.append("ee", "deploymentRepository");

private static final Logger logger = Logger.getLogger(DeploymentRepository.class);

/**
* All deployed modules. This is a copy on write map that is updated infrequently and read often.
*/
Expand Down Expand Up @@ -56,7 +55,7 @@ public synchronized void add(DeploymentModuleIdentifier identifier, ModuleDeploy
try {
listener.deploymentAvailable(identifier, deployment);
} catch (Throwable t) {
logger.error("Exception calling deployment added listener", t);
EjbLogger.ROOT_LOGGER.deploymentAddListenerException(t);
}
}
}
Expand All @@ -78,7 +77,7 @@ public synchronized void remove(DeploymentModuleIdentifier identifier) {
try {
listener.deploymentRemoved(identifier);
} catch (Throwable t) {
logger.error("Exception calling deployment removal listener", t);
EjbLogger.ROOT_LOGGER.deploymentRemoveListenerException(t);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
*/
public class EjbJarParsingDeploymentUnitProcessor implements DeploymentUnitProcessor {

/**
* Logger
*/
private static final Logger logger = Logger.getLogger(EjbJarParsingDeploymentUnitProcessor.class);

/**
* .war file extension
*/
Expand Down Expand Up @@ -253,7 +248,7 @@ private static EjbJarMetaData parseEjbJarXml(final DeploymentUnit deploymentUnit
try {
stream.close();
} catch (IOException ioe) {
logger.warn("Ignoring exception while closing the InputStream ", ioe);
EjbLogger.ROOT_LOGGER.failToCloseFile(ioe);
}
}
}
Expand Down Expand Up @@ -285,7 +280,7 @@ private static EjbJarMetaData parseJBossEjb3Xml(final DeploymentUnit deploymentU
try {
stream.close();
} catch (IOException ioe) {
logger.warn("Ignoring exception while closing the InputStream ", ioe);
EjbLogger.ROOT_LOGGER.failToCloseFile(ioe);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
*/
public class EjbManagementDeploymentUnitProcessor implements DeploymentUnitProcessor {

private static final Logger log = Logger.getLogger(EjbManagementDeploymentUnitProcessor.class);

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
Expand Down Expand Up @@ -95,7 +93,7 @@ public void undeploy(DeploymentUnit deploymentUnit) {
try {
uninstallManagementResource(configuration);
} catch (RuntimeException e) {
log.error(String.format("Failed to remove management resources for %s -- %s", configuration, e));
EjbLogger.ROOT_LOGGER.failedToRemoveManagementResources(configuration, e.getLocalizedMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.jboss.jandex.AnnotationValue;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.logging.Logger;
import org.jboss.metadata.ejb.spec.EjbType;
import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
import org.jboss.metadata.ejb.spec.GenericBeanMetaData;
Expand All @@ -61,8 +60,6 @@
*/
public class SessionBeanComponentDescriptionFactory extends EJBComponentDescriptionFactory {

private static final Logger logger = Logger.getLogger(SessionBeanComponentDescriptionFactory.class);

private static final DotName STATELESS_ANNOTATION = DotName.createSimple(Stateless.class.getName());
private static final DotName STATEFUL_ANNOTATION = DotName.createSimple(Stateful.class.getName());
private static final DotName SINGLETON_ANNOTATION = DotName.createSimple(Singleton.class.getName());
Expand Down Expand Up @@ -118,7 +115,7 @@ private void processSessionBeans(final DeploymentUnit deploymentUnit, final List
final AnnotationTarget target = sessionBeanAnnotation.target();
if (!(target instanceof ClassInfo)) {
// Let's just WARN and move on. No need to throw an error
logger.warn(sessionBeanAnnotation.name() + " annotation is expected to be applied on class level. " + target + " is not a class");
EjbLogger.ROOT_LOGGER.annotationOnlyAllowedOnClass(sessionBeanAnnotation.name().toString(), target);
continue;
}
final ClassInfo sessionBeanClassInfo = (ClassInfo) target;
Expand Down
19 changes: 8 additions & 11 deletions ejb3/src/main/java/org/jboss/as/ejb3/iiop/EjbIIOPService.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import org.jboss.ejb.iiop.EJBMetaDataImplIIOP;
import org.jboss.ejb.iiop.HandleImplIIOP;
import org.jboss.ejb.iiop.HomeHandleImplIIOP;
import org.jboss.logging.Logger;
import org.jboss.marshalling.Marshaller;
import org.jboss.marshalling.MarshallerFactory;
import org.jboss.marshalling.MarshallingConfiguration;
Expand Down Expand Up @@ -100,8 +99,6 @@
*/
public class EjbIIOPService implements Service<EjbIIOPService> {

private static final Logger logger = Logger.getLogger(EjbIIOPService.class);

/**
* The service name
*/
Expand Down Expand Up @@ -270,7 +267,7 @@ public synchronized void start(final StartContext startContext) throws StartExce
iri.mapClass(remoteView.getValue().getViewClass());
iri.mapClass(homeView.getValue().getViewClass());
iri.finishBuild();
logger.info("CORBA interface repository for " + name + ": " + orb.object_to_string(iri.getReference()));
EjbLogger.ROOT_LOGGER.cobraInterfaceRepository(name, orb.object_to_string(iri.getReference()));
}

IORSecurityConfigMetaData iorSecurityConfigMetaData = null;
Expand Down Expand Up @@ -300,7 +297,7 @@ public synchronized void start(final StartContext startContext) throws StartExce
Policy sslPolicy = orb.create_policy(SSL_POLICY_TYPE.value, sslPolicyValue);
policyList.add(sslPolicy);

logger.debug("container's SSL policy: " + sslPolicy);
EjbLogger.ROOT_LOGGER.debug("container's SSL policy: " + sslPolicy);
}

String securityDomain = "CORBA_REMOTE"; //TODO: what should this default to
Expand Down Expand Up @@ -371,7 +368,7 @@ public synchronized void start(final StartContext startContext) throws StartExce

// Register bean home in local CORBA naming context
rebind(corbaNamingContext.getValue(), name, corbaRef);
logger.debug("Home IOR for " + component.getComponentName() + " bound to " + this.name + " in CORBA naming service");
EjbLogger.ROOT_LOGGER.debug("Home IOR for " + component.getComponentName() + " bound to " + this.name + " in CORBA naming service");

//now eagerly force stub creation, so de-serialization of stubs will work correctly
final ClassLoader cl = SecurityActions.getContextClassLoader();
Expand Down Expand Up @@ -407,23 +404,23 @@ public synchronized void stop(final StopContext context) {
NameComponent[] name = corbaContext.to_name(this.name);
corbaContext.unbind(name);
} catch (InvalidName invalidName) {
logger.error("Cannot unregister EJBHome from CORBA naming service", invalidName);
EjbLogger.ROOT_LOGGER.cannotUnregisterEJBHomeFromCobra(invalidName);
} catch (NotFound notFound) {
logger.error("Cannot unregister EJBHome from CORBA naming service", notFound);
EjbLogger.ROOT_LOGGER.cannotUnregisterEJBHomeFromCobra(notFound);
} catch (CannotProceed cannotProceed) {
logger.error("Cannot unregister EJBHome from CORBA naming service", cannotProceed);
EjbLogger.ROOT_LOGGER.cannotUnregisterEJBHomeFromCobra(cannotProceed);
}

// Deactivate the home servant and the bean servant
try {
homeServantRegistry.unbind(homeServantName(this.name));
} catch (Exception e) {
logger.error("Cannot deactivate home servant", e);
EjbLogger.ROOT_LOGGER.cannotDeactivateHomeServant(e);
}
try {
beanServantRegistry.unbind(beanServantName(this.name));
} catch (Exception e) {
logger.error("Cannot deactivate bean servant", e);
EjbLogger.ROOT_LOGGER.cannotDeactivateBeanServant(e);
}

if (iri != null) {
Expand Down
Loading

0 comments on commit 943a99d

Please sign in to comment.