You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/02/19 16:48:09 UTC
svn commit: r1569795 [5/35] - in
/tomee/tomee/trunk/container/openejb-core/src/main: config/pmd/
java/javax/xml/ws/ java/javax/xml/ws/wsaddressing/ java/org/apache/openejb/
java/org/apache/openejb/assembler/
java/org/apache/openejb/assembler/classic/ j...
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ReloadableEntityManagerFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ReloadableEntityManagerFactory.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ReloadableEntityManagerFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ReloadableEntityManagerFactory.java Wed Feb 19 15:47:58 2014
@@ -114,13 +114,13 @@ public class ReloadableEntityManagerFact
final long start = System.nanoTime();
try {
delegate = entityManagerFactoryCallable.call();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new OpenEJBRuntimeException(e);
} finally {
final long time = TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS);
LOGGER.info("assembler.buildingPersistenceUnit", unitInfoImpl.getPersistenceUnitName(), unitInfoImpl.getPersistenceProviderClassName(), time + "");
if (LOGGER.isDebugEnabled()) {
- for (Map.Entry<Object, Object> entry : unitInfoImpl.getProperties().entrySet()) {
+ for (final Map.Entry<Object, Object> entry : unitInfoImpl.getProperties().entrySet()) {
LOGGER.debug(entry.getKey() + "=" + entry.getValue());
}
}
@@ -143,7 +143,7 @@ public class ReloadableEntityManagerFact
EntityManager em;
try {
em = delegate.createEntityManager();
- } catch (LinkageError le) {
+ } catch (final LinkageError le) {
em = delegate.createEntityManager();
}
@@ -154,11 +154,11 @@ public class ReloadableEntityManagerFact
}
@Override
- public EntityManager createEntityManager(Map map) {
+ public EntityManager createEntityManager(final Map map) {
EntityManager em;
try {
em = delegate.createEntityManager(map);
- } catch (LinkageError le) {
+ } catch (final LinkageError le) {
em = delegate.createEntityManager(map);
}
@@ -219,21 +219,21 @@ public class ReloadableEntityManagerFact
server.unregisterMBean(objectName);
}
server.registerMBean(mBeanify(), objectName);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new OpenEJBException("can't register the mbean for the entity manager factory " + getPUname(), e);
- } catch (NoClassDefFoundError ncdfe) {
+ } catch (final NoClassDefFoundError ncdfe) {
objectName = null;
LOGGER.error("can't register the mbean for the entity manager factory {0}", getPUname());
}
}
private ObjectName generateObjectName() {
- ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management");
+ final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management");
jmxName.set("ObjectType", "persistence-unit");
jmxName.set("PersistenceUnit", getPUname());
objectName = jmxName.build();
- MBeanServer server = LocalMBeanServer.get();
+ final MBeanServer server = LocalMBeanServer.get();
if (server.isRegistered(objectName)) { // if 2 pu have the same name...a bit uglier but unique
jmxName.set("PersistenceUnit", getPUname() + "(" + getId() + ")");
objectName = jmxName.build();
@@ -259,7 +259,7 @@ public class ReloadableEntityManagerFact
final MBeanServer server = LocalMBeanServer.get();
try {
server.unregisterMBean(objectName);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new OpenEJBException("can't unregister the mbean for the entity manager factory " + getPUname(), e);
}
}
@@ -272,34 +272,34 @@ public class ReloadableEntityManagerFact
public synchronized void reload() {
try {
createDelegate();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOGGER.error("can't replace EntityManagerFactory " + delegate, e);
}
}
- public synchronized void setSharedCacheMode(SharedCacheMode mode) {
- PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
+ public synchronized void setSharedCacheMode(final SharedCacheMode mode) {
+ final PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
info.setSharedCacheMode(mode);
- Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
+ final Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
if (properties.containsKey(JAVAX_PERSISTENCE_SHARED_CACHE_MODE)) {
properties.setProperty(JAVAX_PERSISTENCE_SHARED_CACHE_MODE, mode.name());
}
}
- public synchronized void setValidationMode(ValidationMode mode) {
- PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
+ public synchronized void setValidationMode(final ValidationMode mode) {
+ final PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
info.setValidationMode(mode);
- Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
+ final Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
if (properties.containsKey(JAVAX_PERSISTENCE_VALIDATION_MODE)) {
properties.setProperty(JAVAX_PERSISTENCE_VALIDATION_MODE, mode.name());
}
}
- public synchronized void setProvider(String providerRaw) {
+ public synchronized void setProvider(final String providerRaw) {
final String provider = providerRaw.trim();
- String newProvider;
+ final String newProvider;
if ("hibernate".equals(provider)) {
newProvider = "org.hibernate.ejb.HibernatePersistence";
} else if ("openjpa".equals(provider)) {
@@ -315,38 +315,38 @@ public class ReloadableEntityManagerFact
try {
classLoader.loadClass(newProvider);
entityManagerFactoryCallable.getUnitInfo().setPersistenceProviderClassName(newProvider);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
LOGGER.error("can't load new provider " + newProvider, e);
}
}
- public synchronized void setTransactionType(PersistenceUnitTransactionType type) {
- PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
+ public synchronized void setTransactionType(final PersistenceUnitTransactionType type) {
+ final PersistenceUnitInfoImpl info = entityManagerFactoryCallable.getUnitInfo();
info.setTransactionType(type);
- Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
+ final Properties properties = entityManagerFactoryCallable.getUnitInfo().getProperties();
if (properties.containsKey(JAVAX_PERSISTENCE_TRANSACTION_TYPE)) {
properties.setProperty(JAVAX_PERSISTENCE_TRANSACTION_TYPE, type.name());
}
}
- public synchronized void setProperty(String key, String value) {
- PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
+ public synchronized void setProperty(final String key, final String value) {
+ final PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
if (unitInfo.getProperties() == null) {
unitInfo.setProperties(new Properties());
}
unitInfo.getProperties().setProperty(key, value);
}
- public synchronized void removeProperty(String key) {
- PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
+ public synchronized void removeProperty(final String key) {
+ final PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
if (unitInfo.getProperties() != null) {
unitInfo.getProperties().remove(key);
}
}
public Properties getUnitProperties() {
- PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
+ final PersistenceUnitInfoImpl unitInfo = entityManagerFactoryCallable.getUnitInfo();
if (unitInfo.getProperties() != null) {
return unitInfo.getProperties();
}
@@ -357,7 +357,7 @@ public class ReloadableEntityManagerFact
return entityManagerFactoryCallable.getUnitInfo().getMappingFileNames();
}
- public void addMappingFile(String file) {
+ public void addMappingFile(final String file) {
if (new File(file).exists()) {
entityManagerFactoryCallable.getUnitInfo().addMappingFileName(file);
} else {
@@ -365,7 +365,7 @@ public class ReloadableEntityManagerFact
}
}
- public void removeMappingFile(String file) {
+ public void removeMappingFile(final String file) {
entityManagerFactoryCallable.getUnitInfo().getMappingFileNames().remove(file);
}
@@ -373,11 +373,11 @@ public class ReloadableEntityManagerFact
return entityManagerFactoryCallable.getUnitInfo().getJarFileUrls();
}
- public void addJarFileUrls(String file) {
+ public void addJarFileUrls(final String file) {
if (new File(file).exists()) { // should we test real urls?
try {
entityManagerFactoryCallable.getUnitInfo().getJarFileUrls().add(new URL(file));
- } catch (MalformedURLException e) {
+ } catch (final MalformedURLException e) {
LOGGER.error("url " + file + " is malformed");
}
} else {
@@ -385,10 +385,10 @@ public class ReloadableEntityManagerFact
}
}
- public void removeJarFileUrls(String file) {
+ public void removeJarFileUrls(final String file) {
try {
entityManagerFactoryCallable.getUnitInfo().getJarFileUrls().remove(new URL(file));
- } catch (MalformedURLException e) {
+ } catch (final MalformedURLException e) {
LOGGER.error("url " + file + " is malformed");
}
}
@@ -397,11 +397,11 @@ public class ReloadableEntityManagerFact
return entityManagerFactoryCallable.getUnitInfo().getManagedClassNames();
}
- public void addManagedClasses(String clazz) {
+ public void addManagedClasses(final String clazz) {
entityManagerFactoryCallable.getUnitInfo().getManagedClassNames().add(clazz);
}
- public void removeManagedClasses(String clazz) {
+ public void removeManagedClasses(final String clazz) {
entityManagerFactoryCallable.getUnitInfo().getManagedClassNames().remove(clazz);
}
@@ -409,7 +409,7 @@ public class ReloadableEntityManagerFact
return entityManagerFactoryCallable.getUnitInfo();
}
- public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses) {
+ public void setExcludeUnlistedClasses(final boolean excludeUnlistedClasses) {
entityManagerFactoryCallable.getUnitInfo().setExcludeUnlistedClasses(excludeUnlistedClasses);
}
@@ -427,7 +427,7 @@ public class ReloadableEntityManagerFact
public static class JMXReloadableEntityManagerFactory {
private ReloadableEntityManagerFactory reloadableEntityManagerFactory;
- public JMXReloadableEntityManagerFactory(ReloadableEntityManagerFactory remf) {
+ public JMXReloadableEntityManagerFactory(final ReloadableEntityManagerFactory remf) {
reloadableEntityManagerFactory = remf;
}
@@ -439,93 +439,93 @@ public class ReloadableEntityManagerFact
@ManagedOperation
@Description("change the current JPA provider")
- public void setProvider(String provider) {
+ public void setProvider(final String provider) {
reloadableEntityManagerFactory.setProvider(provider);
}
@ManagedOperation
@Description("change the current transaction type")
- public void setTransactionType(String type) {
+ public void setTransactionType(final String type) {
try {
- PersistenceUnitTransactionType tt = PersistenceUnitTransactionType.valueOf(type.toUpperCase());
+ final PersistenceUnitTransactionType tt = PersistenceUnitTransactionType.valueOf(type.toUpperCase());
reloadableEntityManagerFactory.setTransactionType(tt);
- } catch (Exception iae) {
+ } catch (final Exception iae) {
// ignored
}
}
@ManagedOperation
@Description("create or modify a property of the persistence unit")
- public void setProperty(String key, String value) {
+ public void setProperty(final String key, final String value) {
reloadableEntityManagerFactory.setProperty(key, value);
}
@ManagedOperation
@Description("remove a property of the persistence unit if it exists")
- public void removeProperty(String key) {
+ public void removeProperty(final String key) {
reloadableEntityManagerFactory.removeProperty(key);
}
@ManagedOperation
@Description("add a mapping file")
- public void addMappingFile(String file) {
+ public void addMappingFile(final String file) {
reloadableEntityManagerFactory.addMappingFile(file);
}
@ManagedOperation
@Description("remove a mapping file")
- public void removeMappingFile(String file) {
+ public void removeMappingFile(final String file) {
reloadableEntityManagerFactory.removeMappingFile(file);
}
@ManagedOperation
@Description("add a managed class")
- public void addManagedClass(String clazz) {
+ public void addManagedClass(final String clazz) {
reloadableEntityManagerFactory.addManagedClasses(clazz);
}
@ManagedOperation
@Description("remove a managed class")
- public void removeManagedClass(String clazz) {
+ public void removeManagedClass(final String clazz) {
reloadableEntityManagerFactory.removeManagedClasses(clazz);
}
@ManagedOperation
@Description("add a jar file")
- public void addJarFile(String file) {
+ public void addJarFile(final String file) {
reloadableEntityManagerFactory.addJarFileUrls(file);
}
@ManagedOperation
@Description("remove a jar file")
- public void removeJarFile(String file) {
+ public void removeJarFile(final String file) {
reloadableEntityManagerFactory.removeJarFileUrls(file);
}
@ManagedOperation
@Description("change the shared cache mode if possible (value is ok)")
- public void setSharedCacheMode(String value) {
+ public void setSharedCacheMode(final String value) {
try {
- SharedCacheMode mode = SharedCacheMode.valueOf(value.trim().toUpperCase());
+ final SharedCacheMode mode = SharedCacheMode.valueOf(value.trim().toUpperCase());
reloadableEntityManagerFactory.setSharedCacheMode(mode);
- } catch (Exception iae) {
+ } catch (final Exception iae) {
// ignored
}
}
@ManagedOperation
@Description("exclude or not unlisted entities")
- public void setExcludeUnlistedClasses(boolean value) {
+ public void setExcludeUnlistedClasses(final boolean value) {
reloadableEntityManagerFactory.setExcludeUnlistedClasses(value);
}
@ManagedOperation
@Description("change the validation mode if possible (value is ok)")
- public void setValidationMode(String value) {
+ public void setValidationMode(final String value) {
try {
- ValidationMode mode = ValidationMode.valueOf(value.trim().toUpperCase());
+ final ValidationMode mode = ValidationMode.valueOf(value.trim().toUpperCase());
reloadableEntityManagerFactory.setValidationMode(mode);
- } catch (Exception iae) {
+ } catch (final Exception iae) {
LOGGER.warning("Can't set validation mode " + value, iae);
reloadableEntityManagerFactory.setProperty(JAVAX_PERSISTENCE_VALIDATION_MODE, value);
}
@@ -533,10 +533,10 @@ public class ReloadableEntityManagerFact
@ManagedOperation
@Description("dump the current configuration for this persistence unit in a file")
- public void dump(String file) {
- PersistenceUnitInfoImpl info = reloadableEntityManagerFactory.entityManagerFactoryCallable.getUnitInfo();
+ public void dump(final String file) {
+ final PersistenceUnitInfoImpl info = reloadableEntityManagerFactory.entityManagerFactoryCallable.getUnitInfo();
- Persistence.PersistenceUnit pu = new Persistence.PersistenceUnit();
+ final Persistence.PersistenceUnit pu = new Persistence.PersistenceUnit();
pu.setJtaDataSource(info.getJtaDataSourceName());
pu.setNonJtaDataSource(info.getNonJtaDataSourceName());
pu.getClazz().addAll(info.getManagedClassNames());
@@ -547,11 +547,11 @@ public class ReloadableEntityManagerFact
pu.setExcludeUnlistedClasses(info.excludeUnlistedClasses());
pu.setSharedCacheMode(PersistenceUnitCaching.fromValue(info.getSharedCacheMode().name()));
pu.setValidationMode(PersistenceUnitValidationMode.fromValue(info.getValidationMode().name()));
- for (URL url : info.getJarFileUrls()) {
+ for (final URL url : info.getJarFileUrls()) {
pu.getJarFile().add(url.toString());
}
- for (String key : info.getProperties().stringPropertyNames()) {
- Persistence.PersistenceUnit.Properties.Property prop = new Persistence.PersistenceUnit.Properties.Property();
+ for (final String key : info.getProperties().stringPropertyNames()) {
+ final Persistence.PersistenceUnit.Properties.Property prop = new Persistence.PersistenceUnit.Properties.Property();
prop.setName(key);
prop.setValue(info.getProperties().getProperty(key));
if (pu.getProperties() == null) {
@@ -560,18 +560,18 @@ public class ReloadableEntityManagerFact
pu.getProperties().getProperty().add(prop);
}
- Persistence persistence = new Persistence();
+ final Persistence persistence = new Persistence();
persistence.setVersion(info.getPersistenceXMLSchemaVersion());
persistence.getPersistenceUnit().add(pu);
try {
- FileWriter writer = new FileWriter(file);
- JAXBContext jc = JAXBContextFactory.newInstance(Persistence.class);
- Marshaller marshaller = jc.createMarshaller();
+ final FileWriter writer = new FileWriter(file);
+ final JAXBContext jc = JAXBContextFactory.newInstance(Persistence.class);
+ final Marshaller marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(persistence, writer);
writer.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOGGER.error("can't dump pu " + reloadableEntityManagerFactory.getPUname() + " in file " + file, e);
}
}
@@ -611,11 +611,11 @@ public class ReloadableEntityManagerFact
reloadableEntityManagerFactory.getManagedClasses(), Info.CLASS);
}
- private TabularData buildTabularData(String typeName, String typeDescription, List<?> list, Info info) {
- String[] names = new String[list.size()];
- Object[] values = new Object[names.length];
+ private TabularData buildTabularData(final String typeName, final String typeDescription, final List<?> list, final Info info) {
+ final String[] names = new String[list.size()];
+ final Object[] values = new Object[names.length];
int i = 0;
- for (Object o : list) {
+ for (final Object o : list) {
names[i] = o.toString();
values[i++] = info.info(reloadableEntityManagerFactory.classLoader, o);
}
@@ -625,20 +625,20 @@ public class ReloadableEntityManagerFact
private enum Info {
URL, NONE, FILE, CLASS;
- public String info(ClassLoader cl, Object o) {
+ public String info(final ClassLoader cl, final Object o) {
switch (this) {
case URL:
try {
if (((URL) o).openConnection().getContentLength() > 0) {
return "valid";
}
- } catch (IOException e) {
+ } catch (final IOException e) {
// ignored
}
return "not valid";
case FILE:
- File file;
+ final File file;
if (o instanceof String) {
file = new File((String) o);
} else if (o instanceof File) {
@@ -652,7 +652,7 @@ public class ReloadableEntityManagerFact
try {
cl.loadClass((String) o);
return "loaded";
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
return "unloadable";
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java Wed Feb 19 15:47:58 2014
@@ -41,40 +41,40 @@ public final class ValidatorBuilder {
// no-op
}
- public static ValidatorFactory buildFactory(ClassLoader classLoader, ValidationInfo info) {
+ public static ValidatorFactory buildFactory(final ClassLoader classLoader, final ValidationInfo info) {
// now we will not be polluted by log build
return buildFactory(info, classLoader);
}
- public static ValidationInfo getInfo(ValidationConfigType config) {
- ValidationInfo info = new ValidationInfo();
+ public static ValidationInfo getInfo(final ValidationConfigType config) {
+ final ValidationInfo info = new ValidationInfo();
if (config != null) {
info.providerClassName = config.getDefaultProvider();
info.constraintFactoryClass = config.getConstraintValidatorFactory();
info.traversableResolverClass = config.getTraversableResolver();
info.messageInterpolatorClass = config.getMessageInterpolator();
- for (PropertyType p : config.getProperty()) {
+ for (final PropertyType p : config.getProperty()) {
info.propertyTypes.put(p.getName(), p.getValue());
}
- for (JAXBElement<String> element : config.getConstraintMapping()) {
+ for (final JAXBElement<String> element : config.getConstraintMapping()) {
info.constraintMappings.add(element.getValue());
}
}
return info;
}
- public static ValidatorFactory buildFactory(ValidationInfo config, ClassLoader classLoader) {
+ public static ValidatorFactory buildFactory(final ValidationInfo config, final ClassLoader classLoader) {
ValidatorFactory factory = null;
- ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader();
+ final ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(classLoader);
if (config == null) {
factory = Validation.buildDefaultValidatorFactory();
} else {
- Configuration<?> configuration = getConfig(config);
+ final Configuration<?> configuration = getConfig(config);
try {
factory = configuration.buildValidatorFactory();
- } catch (ValidationException ve) {
+ } catch (final ValidationException ve) {
Thread.currentThread().setContextClassLoader(ValidatorBuilder.class.getClassLoader());
factory = Validation.buildDefaultValidatorFactory();
Thread.currentThread().setContextClassLoader(classLoader);
@@ -91,9 +91,9 @@ public final class ValidatorBuilder {
}
@SuppressWarnings("unchecked")
- private static Configuration<?> getConfig(ValidationInfo info) {
+ private static Configuration<?> getConfig(final ValidationInfo info) {
Configuration<?> target = null;
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String providerClassName = info.providerClassName;
if (providerClassName == null) {
@@ -102,13 +102,13 @@ public final class ValidatorBuilder {
if (providerClassName != null) {
try {
- @SuppressWarnings({"unchecked","rawtypes"})
+ @SuppressWarnings({"unchecked","rawtypes"}) final
Class clazz = classLoader.loadClass(providerClassName);
target = Validation.byProvider(clazz).configure();
logger.info("Using " + providerClassName + " as validation provider.");
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
logger.warning("Unable to load provider class " + providerClassName, e);
- } catch (ValidationException ve) {
+ } catch (final ValidationException ve) {
logger.warning("Unable create validator factory with provider " + providerClassName
+ " (" + ve.getMessage() + ")."
+ " Default one will be used.");
@@ -123,41 +123,41 @@ public final class ValidatorBuilder {
target.ignoreXmlConfiguration();
- String messageInterpolatorClass = info.messageInterpolatorClass;
+ final String messageInterpolatorClass = info.messageInterpolatorClass;
if (messageInterpolatorClass != null) {
try {
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked") final
Class<MessageInterpolator> clazz = (Class<MessageInterpolator>) classLoader.loadClass(messageInterpolatorClass);
target.messageInterpolator(clazz.newInstance());
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.warning("Unable to set "+messageInterpolatorClass+ " as message interpolator.", e);
}
logger.info("Using " + messageInterpolatorClass + " as message interpolator.");
}
- String traversableResolverClass = info.traversableResolverClass;
+ final String traversableResolverClass = info.traversableResolverClass;
if (traversableResolverClass != null) {
try {
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked") final
Class<TraversableResolver> clazz = (Class<TraversableResolver>) classLoader.loadClass(traversableResolverClass);
target.traversableResolver(clazz.newInstance());
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.warning("Unable to set "+traversableResolverClass+ " as traversable resolver.", e);
}
logger.info("Using " + traversableResolverClass + " as traversable resolver.");
}
- String constraintFactoryClass = info.constraintFactoryClass;
+ final String constraintFactoryClass = info.constraintFactoryClass;
if (constraintFactoryClass != null) {
try {
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked") final
Class<ConstraintValidatorFactory> clazz = (Class<ConstraintValidatorFactory>) classLoader.loadClass(constraintFactoryClass);
target.constraintValidatorFactory(clazz.newInstance());
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.warning("Unable to set "+constraintFactoryClass+ " as constraint factory.", e);
}
logger.info("Using " + constraintFactoryClass + " as constraint factory.");
}
- for (Map.Entry<Object, Object> entry : info.propertyTypes.entrySet()) {
- PropertyType property = new PropertyType();
+ for (final Map.Entry<Object, Object> entry : info.propertyTypes.entrySet()) {
+ final PropertyType property = new PropertyType();
property.setName((String) entry.getKey());
property.setValue((String) entry.getValue());
@@ -166,11 +166,11 @@ public final class ValidatorBuilder {
}
target.addProperty(property.getName(), property.getValue());
}
- for (String mappingFileName : info.constraintMappings) {
+ for (final String mappingFileName : info.constraintMappings) {
if (logger.isDebugEnabled()) {
logger.debug("Opening input stream for " + mappingFileName);
}
- InputStream in = classLoader.getResourceAsStream(mappingFileName);
+ final InputStream in = classLoader.getResourceAsStream(mappingFileName);
if (in == null) {
logger.warning("Unable to open input stream for mapping file " + mappingFileName + ". It will be ignored");
} else {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorFactoryWrapper.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorFactoryWrapper.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorFactoryWrapper.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorFactoryWrapper.java Wed Feb 19 15:47:58 2014
@@ -61,7 +61,7 @@ public class ValidatorFactoryWrapper imp
}
@Override
- public <T> T unwrap(Class<T> tClass) {
+ public <T> T unwrap(final Class<T> tClass) {
return factory().unwrap(tClass);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/WsBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/WsBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/WsBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/WsBuilder.java Wed Feb 19 15:47:58 2014
@@ -30,8 +30,8 @@ import java.util.Collection;
import java.util.List;
public class WsBuilder {
- public static PortData toPortData(PortInfo port, Collection<Injection> injections, URL baseUrl, ClassLoader classLoader) throws OpenEJBException {
- PortData portData = new PortData();
+ public static PortData toPortData(final PortInfo port, final Collection<Injection> injections, final URL baseUrl, final ClassLoader classLoader) throws OpenEJBException {
+ final PortData portData = new PortData();
portData.setPortId(port.portId);
if (port.serviceName != null && port.serviceName.length() != 0) {
portData.setServiceName(QName.valueOf(port.serviceName));
@@ -54,24 +54,24 @@ public class WsBuilder {
return portData;
}
- public static List<HandlerChainData> toHandlerChainData(List<HandlerChainInfo> chains, ClassLoader classLoader) throws OpenEJBException {
- List<HandlerChainData> handlerChains = new ArrayList<HandlerChainData>();
- for (HandlerChainInfo handlerChain : chains) {
- List<HandlerData> handlers = new ArrayList<HandlerData>();
- for (HandlerInfo handler : handlerChain.handlers) {
+ public static List<HandlerChainData> toHandlerChainData(final List<HandlerChainInfo> chains, final ClassLoader classLoader) throws OpenEJBException {
+ final List<HandlerChainData> handlerChains = new ArrayList<HandlerChainData>();
+ for (final HandlerChainInfo handlerChain : chains) {
+ final List<HandlerData> handlers = new ArrayList<HandlerData>();
+ for (final HandlerInfo handler : handlerChain.handlers) {
try {
- Class<?> handlerClass = classLoader.loadClass(handler.handlerClass);
- HandlerData handlerData = new HandlerData(handlerClass);
+ final Class<?> handlerClass = classLoader.loadClass(handler.handlerClass);
+ final HandlerData handlerData = new HandlerData(handlerClass);
handlerData.getInitParams().putAll(handler.initParams);
handlerData.getSoapHeaders().addAll(handler.soapHeaders);
handlerData.getSoapRoles().addAll(handler.soapRoles);
handlers.add(handlerData);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new OpenEJBException("Could not load handler class "+ handler.handlerClass);
}
}
- HandlerChainData handlerChainData = new HandlerChainData(handlerChain.serviceNamePattern,
+ final HandlerChainData handlerChainData = new HandlerChainData(handlerChain.serviceNamePattern,
handlerChain.portNamePattern,
handlerChain.protocolBindings,
handlers);
@@ -81,12 +81,12 @@ public class WsBuilder {
return handlerChains;
}
- public static URL getWsdlURL(String wsdlFile, URL baseUrl, ClassLoader classLoader) {
+ public static URL getWsdlURL(final String wsdlFile, final URL baseUrl, final ClassLoader classLoader) {
URL wsdlURL = null;
if (wsdlFile != null && wsdlFile.length() > 0) {
try {
wsdlURL = new URL(wsdlFile);
- } catch (MalformedURLException e) {
+ } catch (final MalformedURLException e) {
// Not a URL, try as a resource
wsdlURL = classLoader.getResource(wsdlFile);
@@ -95,7 +95,7 @@ public class WsBuilder {
// configurationBaseUrl
try {
wsdlURL = new URL(baseUrl, wsdlFile);
- } catch (MalformedURLException ee) {
+ } catch (final MalformedURLException ee) {
// ignore
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java Wed Feb 19 15:47:58 2014
@@ -28,7 +28,7 @@ public interface ConfigurationInfo {
OpenEjbConfiguration getOpenEjbConfiguration(File tmpFile) throws UnauthorizedException;
class UnauthorizedException extends Exception {
- public UnauthorizedException(String message) {
+ public UnauthorizedException(final String message) {
super(message);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java Wed Feb 19 15:47:58 2014
@@ -30,7 +30,7 @@ import java.io.File;
@Remote(ConfigurationInfo.class)
public class ConfigurationInfoEjb implements ConfigurationInfo {
- public OpenEjbConfiguration getOpenEjbConfiguration(File tmpFile) throws UnauthorizedException {
+ public OpenEjbConfiguration getOpenEjbConfiguration(final File tmpFile) throws UnauthorizedException {
if (tmpFile.exists()) {
return SystemInstance.get().getComponent(OpenEjbConfiguration.class);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java Wed Feb 19 15:47:58 2014
@@ -69,7 +69,7 @@ public class Info2Properties {
try {
// parse the command line arguments
line = parser.parse(options, args);
- } catch (ParseException exp) {
+ } catch (final ParseException exp) {
help(options);
System.exit(-1);
}
@@ -92,11 +92,11 @@ public class Info2Properties {
try {
final InitialContext ctx = new InitialContext(p);
configInfo = (ConfigurationInfo) ctx.lookup("openejb/ConfigurationInfoBusinessRemote");
- } catch (ServiceUnavailableException e) {
+ } catch (final ServiceUnavailableException e) {
System.out.println(e.getCause().getMessage());
System.out.println(messages.format("cmd.deploy.serverOffline"));
System.exit(1);
- } catch (NamingException e) {
+ } catch (final NamingException e) {
System.out.println("ConfigurationInfo does not exist in server '" + serverUrl + "', check the server logs to ensure it exists and has not been removed.");
System.exit(2);
}
@@ -105,7 +105,7 @@ public class Info2Properties {
try {
try {
tempFile = File.createTempFile("configrequest", "txt");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
final File tmp = new File("tmp");
if (!tmp.exists() && !tmp.mkdirs()) {
throw new IOException("Failed to create local tmp directory: " + tmp.getAbsolutePath());
@@ -117,7 +117,7 @@ public class Info2Properties {
if (!tempFile.exists()) {
throw new IllegalStateException("Failed to create tmp file: " + tempFile.getAbsolutePath());
}
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Temp file creation failed.");
e.printStackTrace();
System.exit(1);
@@ -126,7 +126,7 @@ public class Info2Properties {
OpenEjbConfiguration configuration = null;
try {
configuration = configInfo.getOpenEjbConfiguration(tempFile);
- } catch (ConfigurationInfo.UnauthorizedException e) {
+ } catch (final ConfigurationInfo.UnauthorizedException e) {
System.err.println("This tool is currently crippled to only work with server's on the same physical machine. See this JIRA issue for details: http://issues.apache.org/jira/browse/OPENEJB-621");
System.exit(10);
}
@@ -214,7 +214,7 @@ public class Info2Properties {
for (final String prop : misc) {
comment(out, cr, prop + "=" + p2.get(prop));
}
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace(new PrintWriter(new CommentsFilter(out)));
}
}
@@ -267,7 +267,7 @@ public class Info2Properties {
final Map query = new HashMap();
query.put("type", info.types.get(0));
uri += "?" + URISupport.createQueryString(query);
- } catch (Exception e) {
+ } catch (final Exception e) {
// no-op
}
}
@@ -287,7 +287,7 @@ public class Info2Properties {
}
p.store(out, null);
- } catch (IOException e) {
+ } catch (final IOException e) {
out.println("# Printing service(id=" + info.id + ") failed.");
e.printStackTrace(new PrintWriter(new CommentsFilter(out)));
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/PojoUtil.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/PojoUtil.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/PojoUtil.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/PojoUtil.java Wed Feb 19 15:47:58 2014
@@ -30,7 +30,7 @@ public final class PojoUtil {
}
public static Properties findConfiguration(final Collection<IdPropertiesInfo> infos, final String id) {
- for (IdPropertiesInfo info : infos) {
+ for (final IdPropertiesInfo info : infos) {
if (id.equals(info.id)) {
return info.properties;
}
@@ -40,14 +40,14 @@ public final class PojoUtil {
public static Collection<IdPropertiesInfo> findPojoConfig(final Collection<IdPropertiesInfo> pojoConfigurations, final AppInfo appInfo, final WebAppInfo webApp) {
if (pojoConfigurations == null) {
- for (EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
+ for (final EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
if (ejbJarInfo.moduleId.equals(webApp.moduleId)) {
return ejbJarInfo.pojoConfigurations;
}
}
// useless normally but we had some code where modulName was the webapp moduleId
- for (EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
+ for (final EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
if (ejbJarInfo.moduleName.equals(webApp.moduleId)) {
return ejbJarInfo.pojoConfigurations;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/ServiceInfos.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/ServiceInfos.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/ServiceInfos.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/util/ServiceInfos.java Wed Feb 19 15:47:58 2014
@@ -48,7 +48,7 @@ public final class ServiceInfos {
try {
return build(services, find(services, id));
- } catch (OpenEJBException e) {
+ } catch (final OpenEJBException e) {
throw new OpenEJBRuntimeException(e);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/dynamic/PassthroughFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/dynamic/PassthroughFactory.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/dynamic/PassthroughFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/dynamic/PassthroughFactory.java Wed Feb 19 15:47:58 2014
@@ -21,11 +21,11 @@ import org.apache.openejb.assembler.clas
import java.util.Properties;
public class PassthroughFactory {
- public static Object create(Object object) {
+ public static Object create(final Object object) {
return object;
}
- public static void add(ServiceInfo info, Object object) {
+ public static void add(final ServiceInfo info, final Object object) {
info.className = PassthroughFactory.class.getName();
info.constructorArgs.add("object");
info.factoryMethod = "create";
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXContainer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXContainer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXContainer.java Wed Feb 19 15:47:58 2014
@@ -54,7 +54,7 @@ public class JMXContainer {
final BeanContext[] beans = container.getBeanContexts();
final String[] beanNames = new String[beans.length];
int i = 0;
- for (BeanContext bc : beans) {
+ for (final BeanContext bc : beans) {
beanNames[i++] = new StringBuilder("bean-class: ").append(bc.getBeanClass().getName()).append(", ")
.append("ejb-name: ").append(bc.getEjbName()).append(", ")
.append("deployment-id: ").append(bc.getDeploymentID()).append(", ")
@@ -86,7 +86,7 @@ public class JMXContainer {
public String[] getProperties() {
final String[] properties = new String[info.properties.size()];
int i = 0;
- for (Map.Entry<Object, Object> entry : info.properties.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : info.properties.entrySet()) {
properties[i++] = new StringBuilder(entry.getKey().toString())
.append(" = ").append(entry.getValue().toString())
.toString();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXDeployer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/monitoring/JMXDeployer.java Wed Feb 19 15:47:58 2014
@@ -40,7 +40,7 @@ public class JMXDeployer {
try {
deployer().deploy(location);
return "OK";
- } catch (Exception e) {
+ } catch (final Exception e) {
return "ERR:" + e.getMessage();
}
}
@@ -51,7 +51,7 @@ public class JMXDeployer {
try {
deployer().undeploy(moduleId);
return "OK";
- } catch (Exception e) {
+ } catch (final Exception e) {
return "ERR:" + e.getMessage();
}
}
@@ -63,11 +63,11 @@ public class JMXDeployer {
final Collection<AppInfo> apps = deployer().getDeployedApps();
final String[] appsNames = new String[apps.size()];
int i = 0;
- for (AppInfo info : apps) {
+ for (final AppInfo info : apps) {
appsNames[i++] = info.path;
}
return appsNames;
- } catch (Exception e) {
+ } catch (final Exception e) {
return new String[] { "ERR:" + e.getMessage() };
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/async/AsynchronousPool.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/async/AsynchronousPool.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/async/AsynchronousPool.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/async/AsynchronousPool.java Wed Feb 19 15:47:58 2014
@@ -77,7 +77,7 @@ public class AsynchronousPool {
}
return new FutureAdapter<Object>(future, asynchronousCancelled);
- } catch (RejectedExecutionException e) {
+ } catch (final RejectedExecutionException e) {
throw new EJBException("fail to allocate internal resource to execute the target task", e);
}
}
@@ -86,7 +86,7 @@ public class AsynchronousPool {
executor.shutdown();
try { // shouldn't really wait
executor.awaitTermination(awaitDuration.getTime(), awaitDuration.getUnit());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
// no-op
}
}
@@ -181,7 +181,7 @@ public class AsynchronousPool {
try {
object = target.get();
- } catch (Throwable e) {
+ } catch (final Throwable e) {
handleException(e);
}
@@ -198,7 +198,7 @@ public class AsynchronousPool {
try {
object = target.get(timeout, unit);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
handleException(e);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/bval/ValidatorUtil.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/bval/ValidatorUtil.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/bval/ValidatorUtil.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/bval/ValidatorUtil.java Wed Feb 19 15:47:58 2014
@@ -43,7 +43,7 @@ public final class ValidatorUtil {
public static ValidatorFactory validatorFactory() {
try {
return (ValidatorFactory) new InitialContext().lookup("java:comp/ValidatorFactory");
- } catch (NamingException e) {
+ } catch (final NamingException e) {
return proxy(ValidatorFactory.class, "java:comp/ValidatorFactory");
}
}
@@ -51,7 +51,7 @@ public final class ValidatorUtil {
public static Validator validator() {
try {
return (Validator) new InitialContext().lookup("java:comp/Validator");
- } catch (NamingException e) {
+ } catch (final NamingException e) {
return proxy(Validator.class, "java:comp/Validator");
}
}
@@ -63,7 +63,7 @@ public final class ValidatorUtil {
return t.cast(Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{t},
new InvocationHandler() {
@Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
if (Object.class.equals(method.getDeclaringClass())) {
return method.invoke(this);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java Wed Feb 19 15:47:58 2014
@@ -87,7 +87,7 @@ public class CdiAppContextsService exten
this(WebBeansContext.currentInstance(), WebBeansContext.currentInstance().getOpenWebBeansConfiguration().supportsConversation());
}
- public CdiAppContextsService(WebBeansContext wbc, boolean supportsConversation) {
+ public CdiAppContextsService(final WebBeansContext wbc, final boolean supportsConversation) {
if (wbc != null) {
webBeansContext = wbc;
} else {
@@ -120,7 +120,7 @@ public class CdiAppContextsService exten
}
@Override
- public void init(Object initializeObject) {
+ public void init(final Object initializeObject) {
//Start application context
startContext(ApplicationScoped.class, initializeObject);
@@ -153,7 +153,7 @@ public class CdiAppContextsService exten
}
@Override
- public void endContext(Class<? extends Annotation> scopeType, Object endParameters) {
+ public void endContext(final Class<? extends Annotation> scopeType, final Object endParameters) {
if (supportsContext(scopeType)) {
if (scopeType.equals(RequestScoped.class)) {
@@ -180,7 +180,7 @@ public class CdiAppContextsService exten
}
@Override
- public Context getCurrentContext(Class<? extends Annotation> scopeType) {
+ public Context getCurrentContext(final Class<? extends Annotation> scopeType) {
if (scopeType.equals(RequestScoped.class)) {
return getRequestContext();
} else if (scopeType.equals(SessionScoped.class)) {
@@ -199,7 +199,7 @@ public class CdiAppContextsService exten
}
@Override
- public void startContext(Class<? extends Annotation> scopeType, Object startParameter) throws ContextException {
+ public void startContext(final Class<? extends Annotation> scopeType, final Object startParameter) throws ContextException {
if (supportsContext(scopeType)) {
if (scopeType.equals(RequestScoped.class)) {
initRequestContext((ServletRequestEvent) startParameter);
@@ -232,7 +232,7 @@ public class CdiAppContextsService exten
}
@Override
- public boolean supportsContext(Class<? extends Annotation> scopeType) {
+ public boolean supportsContext(final Class<? extends Annotation> scopeType) {
return scopeType.equals(RequestScoped.class)
|| scopeType.equals(SessionScoped.class)
|| scopeType.equals(ApplicationScoped.class)
@@ -242,18 +242,18 @@ public class CdiAppContextsService exten
}
- private void initRequestContext(ServletRequestEvent event) {
- RequestContext rq = new ServletRequestContext();
+ private void initRequestContext(final ServletRequestEvent event) {
+ final RequestContext rq = new ServletRequestContext();
rq.setActive(true);
requestContext.set(rq);// set thread local
if (event != null) {
- HttpServletRequest request = (HttpServletRequest) event.getServletRequest();
+ final HttpServletRequest request = (HttpServletRequest) event.getServletRequest();
((ServletRequestContext) rq).setServletRequest(request);
if (request != null) {
//Re-initialize thread local for session
- HttpSession session = request.getSession(false);
+ final HttpSession session = request.getSession(false);
if (session != null) {
initSessionContext(session);
@@ -320,13 +320,13 @@ public class CdiAppContextsService exten
*
* @param session http session object
*/
- private void initSessionContext(HttpSession session) {
+ private void initSessionContext(final HttpSession session) {
if (session == null) {
// no session -> no SessionContext
return;
}
- String sessionId = session.getId();
+ final String sessionId = session.getId();
//Current context
SessionContext currentSessionContext = sessionCtxManager.getSessionContextWithSessionId(sessionId);
@@ -350,11 +350,11 @@ public class CdiAppContextsService exten
try {
final Constructor<?> constr = clazz.getConstructor(HttpSession.class);
return (SessionContext)constr.newInstance(session);
- } catch (Exception e) {
+ } catch (final Exception e) {
return (SessionContext) clazz.newInstance();
}
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error("Can't instantiate " + classname + ", using default session context", e);
}
}
@@ -367,10 +367,10 @@ public class CdiAppContextsService exten
*
* @param session http session object
*/
- private void destroySessionContext(HttpSession session) {
+ private void destroySessionContext(final HttpSession session) {
if (session != null) {
//Get current session context
- SessionContext context = sessionContext.get();
+ final SessionContext context = sessionContext.get();
//Destroy context
if (context != null) {
@@ -401,14 +401,14 @@ public class CdiAppContextsService exten
*
* @param context context
*/
- private void initConversationContext(ConversationContext context) {
+ private void initConversationContext(final ConversationContext context) {
if (webBeansContext.getService(ConversationService.class) == null) {
return;
}
if (context == null) {
if (conversationContext.get() == null) {
- ConversationContext newContext = new ConversationContext();
+ final ConversationContext newContext = new ConversationContext();
newContext.setActive(true);
conversationContext.set(newContext);
@@ -430,7 +430,7 @@ public class CdiAppContextsService exten
return;
}
- ConversationContext context = getConversationContext();
+ final ConversationContext context = getConversationContext();
if (context != null) {
context.destroy();
@@ -489,14 +489,14 @@ public class CdiAppContextsService exten
logger.debug(">lazyStartSessionContext");
}
- Context webContext = null;
- Context context = getCurrentContext(RequestScoped.class);
+ final Context webContext = null;
+ final Context context = getCurrentContext(RequestScoped.class);
if (context instanceof ServletRequestContext) {
- ServletRequestContext requestContext = (ServletRequestContext) context;
- HttpServletRequest servletRequest = requestContext.getServletRequest();
+ final ServletRequestContext requestContext = (ServletRequestContext) context;
+ final HttpServletRequest servletRequest = requestContext.getServletRequest();
if (null != servletRequest) { // this could be null if there is no active request context
try {
- HttpSession currentSession = servletRequest.getSession();
+ final HttpSession currentSession = servletRequest.getSession();
initSessionContext(currentSession);
/*
@@ -509,7 +509,7 @@ public class CdiAppContextsService exten
if (logger.isDebugEnabled()) {
logger.debug("Lazy SESSION context initialization SUCCESS");
}
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error(OWBLogConst.ERROR_0013, e);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBeanInfo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBeanInfo.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBeanInfo.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBeanInfo.java Wed Feb 19 15:47:58 2014
@@ -69,12 +69,12 @@ public class CdiBeanInfo implements Jndi
}
- public void setInjections(List<Injection> injections) {
+ public void setInjections(final List<Injection> injections) {
this.injections = injections;
}
- public void setBeanName(String beanName) {
+ public void setBeanName(final String beanName) {
this.beanName = beanName;
}
@@ -82,7 +82,7 @@ public class CdiBeanInfo implements Jndi
return classLoader;
}
- public void setClassLoader(ClassLoader classLoader) {
+ public void setClassLoader(final ClassLoader classLoader) {
this.classLoader = classLoader;
}
@@ -91,7 +91,7 @@ public class CdiBeanInfo implements Jndi
private List<LifecycleCallback> afterCompletion;
private Class<?> beanClass;
- public void setBeanClass(Class<?> beanClass) {
+ public void setBeanClass(final Class<?> beanClass) {
this.beanClass = beanClass;
}
@@ -241,7 +241,7 @@ public class CdiBeanInfo implements Jndi
return securityIdentity;
}
- public void setSecurityIdentity(SecurityIdentity value) {
+ public void setSecurityIdentity(final SecurityIdentity value) {
this.securityIdentity = value;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiBuilder.java Wed Feb 19 15:47:58 2014
@@ -65,7 +65,7 @@ public class CdiBuilder {
try {
WebBeansFinder.setSingletonService(SINGLETON_SERVICE);
logger.info("Succeeded in installing singleton service");
- } catch (Exception e) {
+ } catch (final Exception e) {
//ignore
// not logging the exception since it is nto an error
logger.debug("Could not install our singleton service");
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiEjbBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiEjbBean.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiEjbBean.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiEjbBean.java Wed Feb 19 15:47:58 2014
@@ -64,12 +64,12 @@ public class CdiEjbBean<T> extends BaseE
private final BeanContext beanContext;
- public CdiEjbBean(BeanContext beanContext, WebBeansContext webBeansContext, AnnotatedType<T> at) {
+ public CdiEjbBean(final BeanContext beanContext, final WebBeansContext webBeansContext, final AnnotatedType<T> at) {
this(beanContext, webBeansContext, beanContext.getManagedClass(), at, new EjbInjectionTargetFactory<T>(at, webBeansContext));
EjbInjectionTargetImpl.class.cast(getInjectionTarget()).setCdiEjbBean(this);
}
- public CdiEjbBean(BeanContext beanContext, WebBeansContext webBeansContext, Class beanClass, AnnotatedType<T> at, InjectionTargetFactoryImpl<T> factory) {
+ public CdiEjbBean(final BeanContext beanContext, final WebBeansContext webBeansContext, final Class beanClass, final AnnotatedType<T> at, final InjectionTargetFactoryImpl<T> factory) {
super(webBeansContext, toSessionType(beanContext.getComponentType()), at, new EJBBeanAttributesImpl<T>(beanContext,
BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(at).build()), beanClass, factory);
this.beanContext = beanContext;
@@ -81,7 +81,7 @@ public class CdiEjbBean<T> extends BaseE
return this.beanContext;
}
- private static SessionBeanType toSessionType(BeanType beanType) {
+ private static SessionBeanType toSessionType(final BeanType beanType) {
switch (beanType) {
case SINGLETON:
return SessionBeanType.SINGLETON;
@@ -128,13 +128,13 @@ public class CdiEjbBean<T> extends BaseE
if (proxyInstance instanceof BeanContext.Removable) {
try {
((BeanContext.Removable) proxyInstance).$$remove();
- } catch (NoSuchEJBException nsee) {
+ } catch (final NoSuchEJBException nsee) {
// no-op
- } catch (UndeclaredThrowableException nsoe) {
+ } catch (final UndeclaredThrowableException nsoe) {
if (!(nsoe.getCause() instanceof NoSuchObjectException)) {
throw nsoe;
}
- } catch (Exception e) {
+ } catch (final Exception e) {
if (!(e instanceof NoSuchObjectException)) {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
@@ -155,23 +155,23 @@ public class CdiEjbBean<T> extends BaseE
}
private List<Method> findRemove(final Class<?> beanClass, final Class<?> beanInterface) {
- List<Method> toReturn = new ArrayList<Method>();
+ final List<Method> toReturn = new ArrayList<Method>();
// Get all the public methods of the bean class and super class
- Method[] methods = beanClass.getMethods();
+ final Method[] methods = beanClass.getMethods();
// Search for methods annotated with @Remove
- for (Method method : methods) {
- Remove annotation = method.getAnnotation(Remove.class);
+ for (final Method method : methods) {
+ final Remove annotation = method.getAnnotation(Remove.class);
if (annotation != null) {
// Get the corresponding method into the bean interface
- Method interfaceMethod;
+ final Method interfaceMethod;
try {
interfaceMethod = beanInterface.getMethod(method.getName(), method.getParameterTypes());
toReturn.add(interfaceMethod);
- } catch (SecurityException e) {
+ } catch (final SecurityException e) {
e.printStackTrace();
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// The method can not be into the interface in which case we
// don't wonder of
}
@@ -226,7 +226,7 @@ public class CdiEjbBean<T> extends BaseE
return;
}
- Object ejbInstance = dependentSFSBToBeRemoved.remove(System.identityHashCode(instance));
+ final Object ejbInstance = dependentSFSBToBeRemoved.remove(System.identityHashCode(instance));
if (ejbInstance != null) {
destroyStatefulSessionBeanInstance((T) ejbInstance, cc);
} else {
@@ -297,7 +297,7 @@ public class CdiEjbBean<T> extends BaseE
}
@Override
- public InjectionTarget<T> createInjectionTarget(Bean<T> bean) {
+ public InjectionTarget<T> createInjectionTarget(final Bean<T> bean) {
final EjbInjectionTargetImpl<T> injectionTarget = new EjbInjectionTargetImpl<T>(getAnnotatedType(), createInjectionPoints(bean), getWebBeansContext());
final InjectionTarget<T> it = getWebBeansContext().getWebBeansUtil().fireProcessInjectionTargetEvent(injectionTarget, getAnnotatedType()).getCompleteInjectionTarget();
if (!EjbInjectionTargetImpl.class.isInstance(it)) {
@@ -306,9 +306,9 @@ public class CdiEjbBean<T> extends BaseE
return it;
}
- protected Set<InjectionPoint> createInjectionPoints(Bean<T> bean) {
+ protected Set<InjectionPoint> createInjectionPoints(final Bean<T> bean) {
final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
- for (InjectionPoint injectionPoint: getWebBeansContext().getInjectionPointFactory().buildInjectionPoints(bean, getAnnotatedType())) {
+ for (final InjectionPoint injectionPoint: getWebBeansContext().getInjectionPointFactory().buildInjectionPoints(bean, getAnnotatedType())) {
injectionPoints.add(injectionPoint);
}
return injectionPoints;
@@ -327,7 +327,7 @@ public class CdiEjbBean<T> extends BaseE
private CdiEjbBean<T> bean;
private InjectionTarget<T> delegate = null;
- public EjbInjectionTargetImpl(AnnotatedType<T> annotatedType, Set<InjectionPoint> points, WebBeansContext webBeansContext) {
+ public EjbInjectionTargetImpl(final AnnotatedType<T> annotatedType, final Set<InjectionPoint> points, final WebBeansContext webBeansContext) {
super(annotatedType, points, webBeansContext,
Collections.<AnnotatedMethod<?>>emptyList(), Collections.<AnnotatedMethod<?>>emptyList());
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java Wed Feb 19 15:47:58 2014
@@ -103,7 +103,7 @@ public class CdiPlugin extends AbstractO
}
}
- public void setClassLoader(ClassLoader classLoader) {
+ public void setClassLoader(final ClassLoader classLoader) {
this.classLoader = classLoader;
}
@@ -116,7 +116,7 @@ public class CdiPlugin extends AbstractO
}
}
- public void configureDeployments(List<BeanContext> ejbDeployments) {
+ public void configureDeployments(final List<BeanContext> ejbDeployments) {
beans = new WeakHashMap<Class<?>, BeanContext>();
for (final BeanContext deployment : ejbDeployments) {
if (deployment.getComponentType().isSession()) {
@@ -135,7 +135,7 @@ public class CdiPlugin extends AbstractO
}
public void stop() throws OpenEJBException {
- ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+ final ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
try {
// Setting context class loader for cleaning
Thread.currentThread().setContextClassLoader(classLoader);
@@ -159,13 +159,13 @@ public class CdiPlugin extends AbstractO
webBeansContext.getAnnotatedElementFactory().clear();
// Clear the resource injection service
- CdiResourceInjectionService injectionServices = (CdiResourceInjectionService) webBeansContext.getService(ResourceInjectionService.class);
+ final CdiResourceInjectionService injectionServices = (CdiResourceInjectionService) webBeansContext.getService(ResourceInjectionService.class);
injectionServices.clear();
// Clear singleton list
WebBeansFinder.clearInstances(WebBeansUtil.getCurrentClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new OpenEJBException(e);
} finally {
Thread.currentThread().setContextClassLoader(oldCl);
@@ -173,21 +173,21 @@ public class CdiPlugin extends AbstractO
}
@Override
- public <T> T getSupportedService(Class<T> serviceClass) {
+ public <T> T getSupportedService(final Class<T> serviceClass) {
return supportService(serviceClass) ? serviceClass.cast(this) : null;
}
@Override
- public void isManagedBean(Class<?> clazz) {
+ public void isManagedBean(final Class<?> clazz) {
}
@Override
- public boolean supportService(Class<?> serviceClass) {
+ public boolean supportService(final Class<?> serviceClass) {
return serviceClass == TransactionService.class || serviceClass == SecurityService.class;
}
@Override
- public Object getSessionBeanProxy(Bean<?> inBean, Class<?> interfce, CreationalContext<?> creationalContext) {
+ public Object getSessionBeanProxy(final Bean<?> inBean, final Class<?> interfce, final CreationalContext<?> creationalContext) {
Object instance = cacheProxies.get(inBean);
if (instance != null) {
return instance;
@@ -337,7 +337,7 @@ public class CdiPlugin extends AbstractO
final Set<ProducerFieldBean<?>> producerFields = new ProducerFieldBeansBuilder(bean.getWebBeansContext(), bean.getAnnotatedType()).defineProducerFields(bean);
final Map<ProducerMethodBean<?>,AnnotatedMethod<?>> annotatedMethods = new HashMap<ProducerMethodBean<?>, AnnotatedMethod<?>>();
- for(ProducerMethodBean<?> producerMethod : producerMethods) {
+ for(final ProducerMethodBean<?> producerMethod : producerMethods) {
final AnnotatedMethod<?> method = webBeansContext.getAnnotatedElementFactory().newAnnotatedMethod(producerMethod.getCreatorMethod(), annotatedType);
webBeansUtil.inspectErrorStack("There are errors that are added by ProcessProducer event observers for "
+ "ProducerMethods. Look at logs for further details");
@@ -476,7 +476,7 @@ public class CdiPlugin extends AbstractO
}
@Override
- public boolean isSingletonBean(Class<?> clazz) {
+ public boolean isSingletonBean(final Class<?> clazz) {
throw new IllegalStateException("Statement should never be reached");
}
@@ -486,21 +486,21 @@ public class CdiPlugin extends AbstractO
}
@Override
- public boolean isStatelessBean(Class<?> clazz) {
+ public boolean isStatelessBean(final Class<?> clazz) {
throw new IllegalStateException("Statement should never be reached");
}
- public static Method doResolveViewMethod(Bean<?> component, Method declaredMethod) {
+ public static Method doResolveViewMethod(final Bean<?> component, final Method declaredMethod) {
if (!(component instanceof CdiEjbBean)) return declaredMethod;
- CdiEjbBean cdiEjbBean = (CdiEjbBean) component;
+ final CdiEjbBean cdiEjbBean = (CdiEjbBean) component;
final BeanContext beanContext = cdiEjbBean.getBeanContext();
- for (Class intface : beanContext.getBusinessLocalInterfaces()) {
+ for (final Class intface : beanContext.getBusinessLocalInterfaces()) {
try {
return intface.getMethod(declaredMethod.getName(), declaredMethod.getParameterTypes());
- } catch (NoSuchMethodException ignore) {
+ } catch (final NoSuchMethodException ignore) {
// no-op
}
}
@@ -508,7 +508,7 @@ public class CdiPlugin extends AbstractO
}
@Override
- public Method resolveViewMethod(Bean<?> component, Method declaredMethod) {
+ public Method resolveViewMethod(final Bean<?> component, final Method declaredMethod) {
final Method m = doResolveViewMethod(component, declaredMethod);
if (m == null) {
return declaredMethod;
@@ -610,7 +610,7 @@ public class CdiPlugin extends AbstractO
}
@Override
- public void setSpecializedBean(boolean specialized) {
+ public void setSpecializedBean(final boolean specialized) {
// no-op
}
@@ -620,7 +620,7 @@ public class CdiPlugin extends AbstractO
}
@Override
- public void setEnabled(boolean enabled) {
+ public void setEnabled(final boolean enabled) {
// no-op
}
@@ -677,12 +677,12 @@ public class CdiPlugin extends AbstractO
}
@Override
- public T produce(CreationalContext<T> creationalContext) {
+ public T produce(final CreationalContext<T> creationalContext) {
return instance.create(creationalContext);
}
@Override
- public void dispose(T instance) {
+ public void dispose(final T instance) {
ejb.destroyComponentInstance(instance);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java Wed Feb 19 15:47:58 2014
@@ -50,7 +50,7 @@ public class CdiResourceInjectionService
ejbPlugin = CdiPlugin.class.cast(context.getPluginLoader().getEjbPlugin());
}
- public void setAppContext(AppContext appModule) {
+ public void setAppContext(final AppContext appModule) {
for (final BeanContext beanContext : appModule.getBeanContexts()) {
if (beanContext.getBeanClass().equals(BeanContext.Comp.class)) {
compContexts.add(beanContext);
@@ -59,19 +59,19 @@ public class CdiResourceInjectionService
}
@Override
- public <X, T extends Annotation> X getResourceReference(ResourceReference<X, T> resourceReference) {
+ public <X, T extends Annotation> X getResourceReference(final ResourceReference<X, T> resourceReference) {
final Class<X> type = resourceReference.getResourceType();
final String name = resourceReference.getJndiName();
try {
return type.cast(new InitialContext().lookup(name));
- } catch (NamingException e) {
+ } catch (final NamingException e) {
- for (BeanContext beanContext : compContexts) {
+ for (final BeanContext beanContext : compContexts) {
try {
- String relativeName = name.replace("java:", "");
+ final String relativeName = name.replace("java:", "");
return type.cast(beanContext.getJndiContext().lookup(relativeName));
- } catch (NamingException e1) {
+ } catch (final NamingException e1) {
// fine for now
}
}
@@ -81,12 +81,12 @@ public class CdiResourceInjectionService
}
@Override
- public void injectJavaEEResources(Object managedBeanInstance) {
+ public void injectJavaEEResources(final Object managedBeanInstance) {
if (managedBeanInstance != null && ejbPlugin.isSessionBean(managedBeanInstance.getClass())) { // already done
return;
}
- ObjectRecipe receipe = PassthroughFactory.recipe(managedBeanInstance);
+ final ObjectRecipe receipe = PassthroughFactory.recipe(managedBeanInstance);
receipe.allow(Option.FIELD_INJECTION);
receipe.allow(Option.PRIVATE_PROPERTIES);
receipe.allow(Option.IGNORE_MISSING_PROPERTIES);
@@ -98,20 +98,20 @@ public class CdiResourceInjectionService
}
@SuppressWarnings("unchecked")
- private void fillInjectionProperties(ObjectRecipe objectRecipe, Object managedBeanInstance) {
+ private void fillInjectionProperties(final ObjectRecipe objectRecipe, final Object managedBeanInstance) {
final boolean usePrefix = true;
final Class<?> clazz = managedBeanInstance.getClass();
- for (BeanContext beanContext : compContexts) {
+ for (final BeanContext beanContext : compContexts) {
- for (Injection injection : beanContext.getInjections()) {
+ for (final Injection injection : beanContext.getInjections()) {
if (injection.getTarget() == null) continue;
if (!injection.getTarget().isAssignableFrom(clazz)) continue;
try {
- Object value = lookup(beanContext, injection);
+ final Object value = lookup(beanContext, injection);
- String prefix;
+ final String prefix;
if (usePrefix) {
prefix = injection.getTarget().getName() + "/";
} else {
@@ -119,7 +119,7 @@ public class CdiResourceInjectionService
}
objectRecipe.setProperty(prefix + injection.getName(), value);
- } catch (NamingException e) {
+ } catch (final NamingException e) {
logger.warning("Injection data not found in JNDI context: jndiName='" + injection.getJndiName() + "', target=" + injection.getTarget().getName() + "/" + injection.getName());
}
@@ -127,12 +127,12 @@ public class CdiResourceInjectionService
}
}
- private Object lookup(BeanContext beanContext, Injection injection) throws NamingException {
+ private Object lookup(final BeanContext beanContext, final Injection injection) throws NamingException {
String jndiName = injection.getJndiName();
try {
return beanContext.getJndiContext().lookup(jndiName);
- } catch (NamingException e) {
+ } catch (final NamingException e) {
if (!jndiName.startsWith("java:")) {
jndiName = "java:" + jndiName;
@@ -142,7 +142,7 @@ public class CdiResourceInjectionService
try {
value = InjectionProcessor.unwrap(beanContext.getJndiContext()).lookup(jndiName);
- } catch (NamingException e1) {
+ } catch (final NamingException e1) {
// Fallback and try the Context on the current thread
//
// We attempt to create a Context instance for each
@@ -156,7 +156,7 @@ public class CdiResourceInjectionService
try {
value = new InitialContext().lookup(jndiName);
- } catch (NamingException e2) {
+ } catch (final NamingException e2) {
throw e;
}
}
@@ -172,14 +172,14 @@ public class CdiResourceInjectionService
/**
* delegation of serialization behavior
*/
- public <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput out) throws IOException {
+ public <T> void writeExternal(final Bean<T> bean, final T actualResource, final ObjectOutput out) throws IOException {
//do nothing
}
/**
* delegation of serialization behavior
*/
- public <T> T readExternal(Bean<T> bean, ObjectInput out) throws IOException,
+ public <T> T readExternal(final Bean<T> bean, final ObjectInput out) throws IOException,
ClassNotFoundException {
return (T) ((ResourceBean)bean).getActualInstance();
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java Wed Feb 19 15:47:58 2014
@@ -270,7 +270,7 @@ public class CdiScanner implements Scann
private boolean addErrors(final StringBuilder errors, final String msg, final List<String> list) {
if (!list.isEmpty()) {
errors.append("[ ").append(msg).append(" --> ");
- for (String s : list) {
+ for (final String s : list) {
errors.append(s).append(" ");
}
errors.append("]");
@@ -294,12 +294,12 @@ public class CdiScanner implements Scann
* @param classLoader classloader to (try to) load it from
* @return the loaded class if possible, or null if loading fails.
*/
- private Class load(String className, ClassLoader classLoader) {
+ private Class load(final String className, final ClassLoader classLoader) {
try {
return classLoader.loadClass(className);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
return null;
- } catch (NoClassDefFoundError e) {
+ } catch (final NoClassDefFoundError e) {
return null;
}
}