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 [11/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/ ...
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java Wed Feb 19 15:47:58 2014
@@ -79,7 +79,7 @@ public class JndiEncInfoBuilder {
private final Map<String, EjbResolver> ejbJarResolvers = new HashMap<String, EjbResolver>();
private final AppInfo appInfo;
- public JndiEncInfoBuilder(AppInfo appInfo) {
+ public JndiEncInfoBuilder(final AppInfo appInfo) {
this.appInfo = appInfo;
// Global-scoped EJB Resolver
@@ -89,13 +89,13 @@ public class JndiEncInfoBuilder {
this.earResolver = new EjbResolver(globalResolver, EAR, appInfo.ejbJars);
// EJBJAR-scoped EJB Resolver(s)
- for (EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
+ for (final EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
final EjbResolver ejbJarResolver = new EjbResolver(earResolver, EJBJAR, ejbJarInfo);
this.ejbJarResolvers.put(ejbJarInfo.moduleName, ejbJarResolver);
}
}
- private EjbResolver getEjbResolver(String moduleId) {
+ private EjbResolver getEjbResolver(final String moduleId) {
EjbResolver resolver = ejbJarResolvers.get(moduleId);
if (resolver == null) {
resolver = this.earResolver;
@@ -103,7 +103,7 @@ public class JndiEncInfoBuilder {
return resolver;
}
- public void build(JndiConsumer jndiConsumer, String ejbName, String moduleId, URI moduleUri, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) throws OpenEJBException {
+ public void build(final JndiConsumer jndiConsumer, final String ejbName, final String moduleId, final URI moduleUri, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) throws OpenEJBException {
assert moduleJndiEnc != null;
assert compJndiEnc != null;
assert jndiConsumer != null;
@@ -123,14 +123,14 @@ public class JndiEncInfoBuilder {
buildServiceRefInfos(jndiConsumer, moduleJndiEnc, compJndiEnc);
}
- private void buildEjbRefs(JndiConsumer jndiConsumer, URI moduleUri, String moduleId, String ejbName, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) throws OpenEJBException {
+ private void buildEjbRefs(final JndiConsumer jndiConsumer, final URI moduleUri, final String moduleId, final String ejbName, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) throws OpenEJBException {
final Collection<EjbRef> ejbRefs = jndiConsumer.getEjbRef();
final Collection<EjbLocalRef> ejbLocalRefs = jndiConsumer.getEjbLocalRef();
final List<EjbReference> references = new ArrayList<EjbReference>(ejbRefs.size() + ejbLocalRefs.size());
references.addAll(ejbRefs);
references.addAll(ejbLocalRefs);
- for (EjbReference ref : references) {
+ for (final EjbReference ref : references) {
final EjbReferenceInfo info = new EjbReferenceInfo();
info.homeClassName = ref.getHome();
info.interfaceClassName = ref.getInterface();
@@ -165,7 +165,7 @@ public class JndiEncInfoBuilder {
info.externalReference = scope != EAR && scope != EJBJAR;
if (ref.getRefType() == EjbReference.Type.UNKNOWN) {
- EnterpriseBeanInfo otherBean = ejbResolver.getEnterpriseBeanInfo(deploymentId);
+ final EnterpriseBeanInfo otherBean = ejbResolver.getEnterpriseBeanInfo(deploymentId);
if (otherBean != null) {
if (otherBean.businessLocal.contains(ref.getInterface()) || otherBean.ejbClass.equals(ref.getInterface())) {
ref.setRefType(EjbReference.Type.LOCAL);
@@ -199,7 +199,7 @@ public class JndiEncInfoBuilder {
}
}
- private EjbLocalReferenceInfo toLocal(EjbReferenceInfo referenceInfo) {
+ private EjbLocalReferenceInfo toLocal(final EjbReferenceInfo referenceInfo) {
final EjbLocalReferenceInfo local = new EjbLocalReferenceInfo();
local.ejbDeploymentId = referenceInfo.ejbDeploymentId;
local.externalReference = referenceInfo.externalReference;
@@ -213,8 +213,8 @@ public class JndiEncInfoBuilder {
return local;
}
- private void buildServiceRefInfos(JndiConsumer jndiConsumer, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (ServiceRef ref : jndiConsumer.getServiceRef()) {
+ private void buildServiceRefInfos(final JndiConsumer jndiConsumer, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final ServiceRef ref : jndiConsumer.getServiceRef()) {
final ServiceReferenceInfo info = new ServiceReferenceInfo();
info.referenceName = ref.getName();
@@ -240,7 +240,7 @@ public class JndiEncInfoBuilder {
info.jaxrpcMappingFile = ref.getJaxrpcMappingFile();
info.handlerChains.addAll(ConfigurationFactory.toHandlerChainInfo(ref.getAllHandlers()));
- for (PortComponentRef portComponentRef : ref.getPortComponentRef()) {
+ for (final PortComponentRef portComponentRef : ref.getPortComponentRef()) {
final PortRefInfo portRefInfo = new PortRefInfo();
portRefInfo.qname = portComponentRef.getQName();
portRefInfo.serviceEndpointInterface = portComponentRef.getServiceEndpointInterface();
@@ -251,9 +251,9 @@ public class JndiEncInfoBuilder {
}
}
- private void buildPersistenceUnitRefInfos(JndiConsumer jndiConsumer, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (PersistenceUnitRef puRef : jndiConsumer.getPersistenceUnitRef()) {
- PersistenceUnitReferenceInfo info = new PersistenceUnitReferenceInfo();
+ private void buildPersistenceUnitRefInfos(final JndiConsumer jndiConsumer, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final PersistenceUnitRef puRef : jndiConsumer.getPersistenceUnitRef()) {
+ final PersistenceUnitReferenceInfo info = new PersistenceUnitReferenceInfo();
info.referenceName = puRef.getPersistenceUnitRefName();
info.persistenceUnitName = puRef.getPersistenceUnitName();
info.unitId = puRef.getMappedName();
@@ -263,8 +263,8 @@ public class JndiEncInfoBuilder {
}
}
- private void buildPersistenceContextRefInfos(JndiConsumer jndiConsumer, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (PersistenceContextRef contextRef : jndiConsumer.getPersistenceContextRef()) {
+ private void buildPersistenceContextRefInfos(final JndiConsumer jndiConsumer, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final PersistenceContextRef contextRef : jndiConsumer.getPersistenceContextRef()) {
final PersistenceContextReferenceInfo info = new PersistenceContextReferenceInfo();
info.referenceName = contextRef.getPersistenceContextRefName();
info.persistenceUnitName = contextRef.getPersistenceUnitName();
@@ -273,9 +273,9 @@ public class JndiEncInfoBuilder {
info.extended = contextRef.getPersistenceContextType() == PersistenceContextType.EXTENDED;
final List<Property> persistenceProperty = contextRef.getPersistenceProperty();
- for (Property property : persistenceProperty) {
- String name = property.getName();
- String value = property.getValue();
+ for (final Property property : persistenceProperty) {
+ final String name = property.getName();
+ final String value = property.getValue();
info.properties.setProperty(name, value);
}
info.targets.addAll(buildInjectionInfos(contextRef));
@@ -290,8 +290,8 @@ public class JndiEncInfoBuilder {
}
}
- private void buildResourceRefInfos(JndiConsumer item, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (ResourceRef res : item.getResourceRef()) {
+ private void buildResourceRefInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final ResourceRef res : item.getResourceRef()) {
final ResourceReferenceInfo info;
if (res instanceof ContextRef) {
info = new ContextReferenceInfo();
@@ -320,8 +320,8 @@ public class JndiEncInfoBuilder {
}
}
- private void buildResourceEnvRefInfos(JndiConsumer item, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (ResourceEnvRef res : item.getResourceEnvRef()) {
+ private void buildResourceEnvRefInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final ResourceEnvRef res : item.getResourceEnvRef()) {
final ResourceEnvReferenceInfo info = new ResourceEnvReferenceInfo();
info.referenceName = res.getResourceEnvRefName();
info.resourceEnvRefType = res.getResourceEnvRefType();
@@ -337,7 +337,7 @@ public class JndiEncInfoBuilder {
compJndiEnc.resourceEnvRefs
);
}
- for (MessageDestinationRef res : item.getMessageDestinationRef()) {
+ for (final MessageDestinationRef res : item.getMessageDestinationRef()) {
final ResourceEnvReferenceInfo info = new ResourceEnvReferenceInfo();
info.referenceName = res.getMessageDestinationRefName();
info.resourceEnvRefType = res.getMessageDestinationType();
@@ -355,8 +355,8 @@ public class JndiEncInfoBuilder {
}
}
- private void buildEnvEntryInfos(JndiConsumer item, JndiEncInfo moduleJndiEnc, JndiEncInfo compJndiEnc) {
- for (EnvEntry env : item.getEnvEntry()) {
+ private void buildEnvEntryInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
+ for (final EnvEntry env : item.getEnvEntry()) {
// ignore env entries without a value and lookup name
//If the the reference name of the environment entry is belong to those shareable JNDI name space, it somewhat is a valid one
if (env.getEnvEntryValue() == null && env.getLookupName() == null && !isShareableJNDINamespace(env.getEnvEntryName())) {
@@ -380,11 +380,11 @@ public class JndiEncInfoBuilder {
}
}
- private boolean isShareableJNDINamespace(String jndiName) {
+ private boolean isShareableJNDINamespace(final String jndiName) {
return jndiName.startsWith("java:global/") || jndiName.startsWith("java:app/") || jndiName.startsWith("java:module/");
}
- private ReferenceLocationInfo buildLocationInfo(JndiReference reference) {
+ private ReferenceLocationInfo buildLocationInfo(final JndiReference reference) {
final String lookupName = reference.getLookupName();
if (lookupName != null) {
final ReferenceLocationInfo location = new ReferenceLocationInfo();
@@ -409,9 +409,9 @@ public class JndiEncInfoBuilder {
return null;
}
- private Collection<? extends InjectionInfo> buildInjectionInfos(Injectable injectable) {
+ private Collection<? extends InjectionInfo> buildInjectionInfos(final Injectable injectable) {
final List<InjectionInfo> infos = new ArrayList<InjectionInfo>();
- for (InjectionTarget target : injectable.getInjectionTarget()) {
+ for (final InjectionTarget target : injectable.getInjectionTarget()) {
final InjectionInfo info = new InjectionInfo();
info.className = target.getInjectionTargetClass();
info.propertyName = target.getInjectionTargetName();
@@ -420,7 +420,7 @@ public class JndiEncInfoBuilder {
return infos;
}
- public void buildDependsOnRefs(EnterpriseBean enterpriseBean, EnterpriseBeanInfo beanInfo, String moduleId) throws OpenEJBException {
+ public void buildDependsOnRefs(final EnterpriseBean enterpriseBean, final EnterpriseBeanInfo beanInfo, final String moduleId) throws OpenEJBException {
if (!(enterpriseBean instanceof SessionBean)) {
return;
}
@@ -435,7 +435,7 @@ public class JndiEncInfoBuilder {
final EjbResolver ejbResolver = getEjbResolver(moduleId);
if (sessionBean.getDependsOn() != null) {
- for (String ejbName : sessionBean.getDependsOn()) {
+ for (final String ejbName : sessionBean.getDependsOn()) {
final String deploymentId = ejbResolver.resolve(new SimpleRef(ejbName), moduleUri);
if (deploymentId != null) {
beanInfo.dependsOn.add(deploymentId);
@@ -444,7 +444,7 @@ public class JndiEncInfoBuilder {
}
}
- private boolean isIntefaceLocalBean(String interfaceClassName) {
+ private boolean isIntefaceLocalBean(final String interfaceClassName) {
if (interfaceClassName == null) {
return false;
}
@@ -452,15 +452,15 @@ public class JndiEncInfoBuilder {
return isLocalBean(beanInfo) && beanInfo.parents.contains(interfaceClassName);
}
- private EnterpriseBeanInfo getInterfaceBeanInfo(String interfaceClassName) {
+ private EnterpriseBeanInfo getInterfaceBeanInfo(final String interfaceClassName) {
if (interfaceClassName == null) {
throw new IllegalArgumentException("interfaceClassName cannot be null");
}
final List<EjbJarInfo> ejbJars = appInfo.ejbJars;
- for (EjbJarInfo ejbJar : ejbJars) {
+ for (final EjbJarInfo ejbJar : ejbJars) {
final List<EnterpriseBeanInfo> enterpriseBeans = ejbJar.enterpriseBeans;
- for (EnterpriseBeanInfo enterpriseBean : enterpriseBeans) {
+ for (final EnterpriseBeanInfo enterpriseBean : enterpriseBeans) {
if (interfaceClassName.equals(enterpriseBean.ejbClass)
|| interfaceClassName.equals(enterpriseBean.local)
|| interfaceClassName.equals(enterpriseBean.remote)
@@ -472,8 +472,8 @@ public class JndiEncInfoBuilder {
}
// look if it is an abstract injection (local bean)
- for (EjbJarInfo ejbJar : ejbJars) {
- for (EnterpriseBeanInfo enterpriseBean : ejbJar.enterpriseBeans) {
+ for (final EjbJarInfo ejbJar : ejbJars) {
+ for (final EnterpriseBeanInfo enterpriseBean : ejbJar.enterpriseBeans) {
if (enterpriseBean.parents.contains(interfaceClassName)) {
return enterpriseBean;
}
@@ -483,14 +483,14 @@ public class JndiEncInfoBuilder {
return null;
}
- private boolean isLocalBean(EnterpriseBeanInfo beanInfo) {
+ private boolean isLocalBean(final EnterpriseBeanInfo beanInfo) {
return beanInfo != null && beanInfo.localbean;
}
private static class SimpleRef implements EjbResolver.Reference {
private final String name;
- public SimpleRef(String name) {
+ public SimpleRef(final String name) {
this.name = name;
}
@@ -527,7 +527,7 @@ public class JndiEncInfoBuilder {
private static class Ref implements EjbResolver.Reference {
private final EjbReference ref;
- public Ref(EjbReference ref) {
+ public Ref(final EjbReference ref) {
this.ref = ref;
}
@@ -563,8 +563,8 @@ public class JndiEncInfoBuilder {
}
}
- public <I extends InjectableInfo> void insert(I i, List<I> global, List<I> app, List<I> module, List<I> comp) {
- String name = i.referenceName;
+ public <I extends InjectableInfo> void insert(final I i, final List<I> global, final List<I> app, final List<I> module, final List<I> comp) {
+ final String name = i.referenceName;
if (!name.startsWith("java:")) {
i.referenceName = "comp/env/" + name;
comp.add(i);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java Wed Feb 19 15:47:58 2014
@@ -37,17 +37,17 @@ import static org.apache.openejb.jee.Ses
public class LegacyProcessor implements DynamicDeployer {
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- ClassLoader classLoader = ejbModule.getClassLoader();
- for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ final ClassLoader classLoader = ejbModule.getClassLoader();
+ for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
if (bean.getEjbClass() == null) continue;
try {
- Class<?> clazz = classLoader.loadClass(bean.getEjbClass());
+ final Class<?> clazz = classLoader.loadClass(bean.getEjbClass());
process(clazz, bean);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// skip, we'll get this in validation
}
}
@@ -56,24 +56,24 @@ public class LegacyProcessor implements
return appModule;
}
- public static void process(Class<?> clazz, EnterpriseBean bean) {
+ public static void process(final Class<?> clazz, final EnterpriseBean bean) {
if (bean instanceof SessionBean) {
- SessionBean sessionBean = (SessionBean) bean;
+ final SessionBean sessionBean = (SessionBean) bean;
if (sessionBean.getSessionType() == STATEFUL && SessionSynchronization.class.isAssignableFrom(clazz)) {
try {
sessionBean.getAfterBegin().add(new LifecycleCallback(clazz.getMethod("afterBegin")));
sessionBean.getBeforeCompletion().add(new LifecycleCallback(clazz.getMethod("beforeCompletion")));
sessionBean.getAfterCompletion().add(new LifecycleCallback(clazz.getMethod("afterCompletion", boolean.class)));
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
//Ignore, should never happen
}
}
if (javax.ejb.SessionBean.class.isAssignableFrom(clazz)) {
final ResourceEnvRef ref = new ResourceEnvRef("javax.ejb.SessionBean/sessionContext", SessionContext.class);
- InjectionTarget target = new InjectionTarget();
+ final InjectionTarget target = new InjectionTarget();
target.setInjectionTargetClass(clazz);
target.setInjectionTargetName("sessionContext");
ref.getInjectionTarget().add(target);
@@ -83,11 +83,11 @@ public class LegacyProcessor implements
}
if (bean instanceof MessageDrivenBean) {
- MessageDrivenBean messageDrivenBean = (MessageDrivenBean) bean;
+ final MessageDrivenBean messageDrivenBean = (MessageDrivenBean) bean;
if (javax.ejb.MessageDrivenBean.class.isAssignableFrom(clazz)) {
final ResourceEnvRef ref = new ResourceEnvRef("javax.ejb.MessageDrivenBean/messageDrivenContext", MessageDrivenContext.class);
- InjectionTarget target = new InjectionTarget();
+ final InjectionTarget target = new InjectionTarget();
target.setInjectionTargetClass(clazz);
target.setInjectionTargetName("messageDrivenContext");
ref.getInjectionTarget().add(target);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java Wed Feb 19 15:47:58 2014
@@ -45,27 +45,27 @@ import java.util.Map;
public class LinkBuiltInTypes implements DynamicDeployer {
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
- for (ClientModule module : appModule.getClientModules()) {
+ for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
if (consumer == null) continue;
link(consumer);
}
- for (WebModule module : appModule.getWebModules()) {
+ for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
if (consumer == null) continue;
link(consumer);
}
- for (EjbModule module : appModule.getEjbModules()) {
+ for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) continue;
- for (EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
link(consumer);
}
}
@@ -74,10 +74,10 @@ public class LinkBuiltInTypes implements
}
- private void link(JndiConsumer consumer) {
+ private void link(final JndiConsumer consumer) {
- Map<String, String> links = new HashMap<String, String>();
+ final Map<String, String> links = new HashMap<String, String>();
add(links, BeanManager.class);
add(links, Validator.class);
@@ -89,11 +89,11 @@ public class LinkBuiltInTypes implements
add(links, TimerService.class);
add(links, WebServiceContext.class);
- List<JndiReference> refs = new ArrayList<JndiReference>();
+ final List<JndiReference> refs = new ArrayList<JndiReference>();
refs.addAll(consumer.getResourceRef());
refs.addAll(consumer.getResourceEnvRef());
- for (JndiReference ref : refs) {
+ for (final JndiReference ref : refs) {
final String link = links.get(ref.getType());
if (link == null) continue;
@@ -108,10 +108,10 @@ public class LinkBuiltInTypes implements
}
}
- private void add(Map<String, String> links, Class<?> type, Class... aliases) {
+ private void add(final Map<String, String> links, final Class<?> type, final Class... aliases) {
links.put(type.getName(), "java:comp/"+type.getSimpleName());
- for (Class clazz : aliases) {
+ for (final Class clazz : aliases) {
links.put(clazz.getName(), "java:comp/"+type.getSimpleName());
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MBeanDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MBeanDeployer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MBeanDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MBeanDeployer.java Wed Feb 19 15:47:58 2014
@@ -38,7 +38,7 @@ public class MBeanDeployer implements Dy
// mbean classes themself are stored in modules since they depend only on them
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
logger.debug("looking for annotated MBeans in " + appModule.getModuleId());
final List<String> done = new ArrayList<String>();
@@ -55,21 +55,21 @@ public class MBeanDeployer implements Dy
try { // for OSGi environment, javax.management is imported by the JRE
mbeanClasses.add((Class<? extends Annotation>) cl.loadClass("javax.management.MBean"));
- } catch (NoClassDefFoundError noClassDefFoundError) {
+ } catch (final NoClassDefFoundError noClassDefFoundError) {
// ignored
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// ignored
}
// there is an ejbmodule by webapp so we should't need to go through the webapp
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
if (ejbModule.getFinder() == null) {
continue;
}
- for (Class<? extends Annotation> mclazz : mbeanClasses) {
- for (Annotated<Class<?>> clazz : ejbModule.getFinder().findMetaAnnotatedClasses(mclazz)) {
+ for (final Class<? extends Annotation> mclazz : mbeanClasses) {
+ for (final Annotated<Class<?>> clazz : ejbModule.getFinder().findMetaAnnotatedClasses(mclazz)) {
final Class<?> realClass = clazz.get();
final String name = realClass.getName();
if (done.contains(name)) {
@@ -81,13 +81,13 @@ public class MBeanDeployer implements Dy
}
}
}
- for (ClientModule clientModule : appModule.getClientModules()) {
+ for (final ClientModule clientModule : appModule.getClientModules()) {
if (clientModule.getFinder() == null) {
continue;
}
- for (Class<? extends Annotation> mclazz : mbeanClasses) {
- for (Annotated<Class<?>> clazz : clientModule.getFinder().findMetaAnnotatedClasses(mclazz)) {
+ for (final Class<? extends Annotation> mclazz : mbeanClasses) {
+ for (final Annotated<Class<?>> clazz : clientModule.getFinder().findMetaAnnotatedClasses(mclazz)) {
final String name = clazz.get().getName();
if (done.contains(name)) {
continue;
@@ -98,11 +98,11 @@ public class MBeanDeployer implements Dy
}
}
- List<URL> libs = appModule.getAdditionalLibraries();
- Iterator<URL> it = libs.iterator();
+ final List<URL> libs = appModule.getAdditionalLibraries();
+ final Iterator<URL> it = libs.iterator();
while (it.hasNext()) {
- URL url = it.next();
- for (String location : done) {
+ final URL url = it.next();
+ for (final String location : done) {
if (url.getFile().equals(location)) {
it.remove();
}
@@ -111,8 +111,8 @@ public class MBeanDeployer implements Dy
if (libs.size() > 0) {
// force descriptor for additinal libs since it shouldn't occur often and can save some time
final IAnnotationFinder finder = new AnnotationFinder(new ConfigurableClasspathArchive(appModule.getClassLoader(), true, libs));
- for (Class<? extends Annotation> mclazz : mbeanClasses) {
- for (Annotated<Class<?>> clazz : finder.findMetaAnnotatedClasses(mclazz)) {
+ for (final Class<? extends Annotation> mclazz : mbeanClasses) {
+ for (final Annotated<Class<?>> clazz : finder.findMetaAnnotatedClasses(mclazz)) {
final String name = clazz.get().getName();
if (done.contains(name)) {
continue;
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MappedNameBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MappedNameBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MappedNameBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MappedNameBuilder.java Wed Feb 19 15:47:58 2014
@@ -26,22 +26,22 @@ import org.apache.openejb.jee.oejb3.Open
import java.util.Map;
public class MappedNameBuilder implements DynamicDeployer{
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- OpenejbJar openejbJar = ejbModule.getOpenejbJar();
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
if (openejbJar == null) {
return appModule;
}
- Map<String, EjbDeployment> ejbDeployments = openejbJar.getDeploymentsByEjbName();
- for (EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
- EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
+ final Map<String, EjbDeployment> ejbDeployments = openejbJar.getDeploymentsByEjbName();
+ for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ final EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
if (ejbDeployment == null) {
continue;
}
- String mappedName = enterpriseBean.getMappedName();
+ final String mappedName = enterpriseBean.getMappedName();
if (mappedName != null && mappedName.length() > 0) {
ejbDeployment.getJndi().add(new Jndi(mappedName, "Remote"));
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java Wed Feb 19 15:47:58 2014
@@ -47,12 +47,12 @@ import java.util.Map;
public class MergeWebappJndiContext implements DynamicDeployer {
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
- for (WebModule webModule : appModule.getWebModules()) {
+ for (final WebModule webModule : appModule.getWebModules()) {
if (webModule.getFinder() == null) continue;
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
// If they are the same module, they'll have the same finder
if (ejbModule.getFinder() != webModule.getFinder()) continue;
@@ -63,12 +63,12 @@ public class MergeWebappJndiContext impl
return appModule;
}
- private void merge(EjbModule ejbModule, WebModule webModule) {
+ private void merge(final EjbModule ejbModule, final WebModule webModule) {
final JndiConsumer webApp = webModule.getWebApp();
final EjbJar ejbJar = ejbModule.getEjbJar();
- for (EnterpriseBean bean : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean bean : ejbJar.getEnterpriseBeans()) {
merge(bean.getEnvEntryMap(), webApp.getEnvEntryMap());
merge(bean.getEjbRefMap(), webApp.getEjbRefMap());
merge(bean.getEjbLocalRefMap(), webApp.getEjbLocalRefMap());
@@ -87,7 +87,7 @@ public class MergeWebappJndiContext impl
final SessionBean aggregator = new SessionBean(); // easy way to get a JndiConsumer
- for (EnterpriseBean a : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean a : ejbJar.getEnterpriseBeans()) {
aggregator.getEnvEntryMap().putAll(a.getEnvEntryMap());
aggregator.getEjbRefMap().putAll(a.getEjbRefMap());
aggregator.getEjbLocalRefMap().putAll(a.getEjbLocalRefMap());
@@ -99,7 +99,7 @@ public class MergeWebappJndiContext impl
aggregator.getPersistenceUnitRefMap().putAll(a.getPersistenceUnitRefMap());
}
- for (EnterpriseBean a : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean a : ejbJar.getEnterpriseBeans()) {
copy(aggregator.getEnvEntryMap(), a.getEnvEntryMap());
copy(aggregator.getEjbRefMap(), a.getEjbRefMap());
copy(aggregator.getEjbLocalRefMap(), a.getEjbLocalRefMap());
@@ -118,13 +118,13 @@ public class MergeWebappJndiContext impl
/**
* Bidirectional a-b merge
*/
- private <R extends JndiReference> void merge(Map<String, R> a, Map<String, R> b) {
+ private <R extends JndiReference> void merge(final Map<String, R> a, final Map<String, R> b) {
copy(a, b);
copy(b, a);
}
- private <R extends JndiReference> void copy(Map<String, R> from, Map<String, R> to) {
- for (R a : from.values()) {
+ private <R extends JndiReference> void copy(final Map<String, R> from, final Map<String, R> to) {
+ for (final R a : from.values()) {
if (isPrivateReference(a)) continue;
@@ -159,34 +159,34 @@ public class MergeWebappJndiContext impl
}
}
- private static <R extends JndiReference> boolean isExtendedPersistenceContext(R b) {
+ private static <R extends JndiReference> boolean isExtendedPersistenceContext(final R b) {
return b instanceof PersistenceContextRef
&& PersistenceContextType.EXTENDED.equals(((PersistenceContextRef) b).getPersistenceContextType());
}
- private <R extends JndiReference> boolean isPrivateReference(R a) {
+ private <R extends JndiReference> boolean isPrivateReference(final R a) {
if (!isResourceRef(a)) return false;
- Class[] types = {EJBContext.class, EntityContext.class, SessionContext.class, MessageDrivenContext.class, UserTransaction.class};
+ final Class[] types = {EJBContext.class, EntityContext.class, SessionContext.class, MessageDrivenContext.class, UserTransaction.class};
- for (Class type : types) {
+ for (final Class type : types) {
if (type.getName().equals(a.getType())) return true;
}
return false;
}
- private <R extends JndiReference> boolean isResourceRef(R a) {
+ private <R extends JndiReference> boolean isResourceRef(final R a) {
return a instanceof ResourceRef || a instanceof ResourceEnvRef;
}
- private <R extends JndiReference> void mergeUserTransaction(Map<String, R> from, Map<String, R> to, JndiConsumer consumer) {
+ private <R extends JndiReference> void mergeUserTransaction(final Map<String, R> from, final Map<String, R> to, final JndiConsumer consumer) {
if (consumer instanceof EnterpriseBean) {
final EnterpriseBean enterpriseBean = (EnterpriseBean) consumer;
if (enterpriseBean.getTransactionType() != TransactionType.BEAN) return;
}
- for (R a : from.values()) {
+ for (final R a : from.values()) {
if (!UserTransaction.class.getName().equals(a.getType())) continue;
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java Wed Feb 19 15:47:58 2014
@@ -41,7 +41,7 @@ public class Module {
private final Set<String> mbeans = new HashSet<String>();
private final Properties properties = new SuperProperties().caseInsensitive(true);
- public Module(boolean needId) {
+ public Module(final boolean needId) {
if (needId) {
uniqueId = Integer.toString(currentId++);
}
@@ -59,7 +59,7 @@ public class Module {
return validationConfig;
}
- public void setValidationConfig(ValidationConfigType v) {
+ public void setValidationConfig(final ValidationConfigType v) {
validationConfig = v;
}
@@ -75,7 +75,7 @@ public class Module {
return isStandaloneModule;
}
- public void setStandaloneModule(boolean isStandalone) {
+ public void setStandaloneModule(final boolean isStandalone) {
isStandaloneModule = isStandalone;
}
@@ -83,11 +83,11 @@ public class Module {
return classLoader;
}
- public void setClassLoader(ClassLoader classLoader) {
+ public void setClassLoader(final ClassLoader classLoader) {
this.classLoader = classLoader;
}
- public void initAppModule(AppModule appModule) {
+ public void initAppModule(final AppModule appModule) {
if (this.appModule == appModule) {
return;
}
@@ -107,7 +107,7 @@ public class Module {
return appModule;
}
- public void initResources(Resources resources) {
+ public void initResources(final Resources resources) {
if (this.resources != null) {
throw new UnsupportedOperationException("resources.xml is already set");
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ModuleProperties.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ModuleProperties.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ModuleProperties.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ModuleProperties.java Wed Feb 19 15:47:58 2014
@@ -35,13 +35,13 @@ public class ModuleProperties implements
private static final Logger log = Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG, ModuleProperties.class);
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
final Properties overrides = new Properties();
overrides.putAll(SystemInstance.get().getProperties());
overrides.putAll(appModule.getProperties());
- for (DeploymentModule module : appModule.getDeploymentModule()) {
+ for (final DeploymentModule module : appModule.getDeploymentModule()) {
readProperties(module);
@@ -52,7 +52,7 @@ public class ModuleProperties implements
return appModule;
}
- private static void readProperties(DeploymentModule module) throws OpenEJBException {
+ private static void readProperties(final DeploymentModule module) throws OpenEJBException {
final Object o = module.getAltDDs().get("module.properties");
if (o instanceof URL) {
@@ -60,7 +60,7 @@ public class ModuleProperties implements
try {
final Properties properties = IO.readProperties(url);
module.getProperties().putAll(properties);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new OpenEJBException("Cannot read module.properties: " + url, e);
}
} else if (o instanceof Properties) {
@@ -70,10 +70,10 @@ public class ModuleProperties implements
}
}
- private static void applyOverrides(Properties overrides, DeploymentModule module) {
+ private static void applyOverrides(final Properties overrides, final DeploymentModule module) {
final String id = module.getModuleId() + ".";
- for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : overrides.entrySet()) {
final String key = entry.getKey().toString();
if (key.startsWith(id)) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NewLoaderLogic.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NewLoaderLogic.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NewLoaderLogic.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NewLoaderLogic.java Wed Feb 19 15:47:58 2014
@@ -192,7 +192,7 @@ public class NewLoaderLogic {
return true;
}
}
- } catch (IllegalArgumentException iae) {
+ } catch (final IllegalArgumentException iae) {
// no-op
}
@@ -251,7 +251,7 @@ public class NewLoaderLogic {
logger.info("Loaded classpath exclusions from: " + exclusionsFile.getAbsolutePath());
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// ignored
} finally {
IO.close(fis);
@@ -313,7 +313,7 @@ public class NewLoaderLogic {
logger.debug("Loaded default.exclusions");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// ignored
} finally {
IO.close(is);
@@ -353,13 +353,13 @@ public class NewLoaderLogic {
list.add(sanitize(value));
}
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
logger.warning("readInputStreamList: Failed to read provided stream");
} finally {
if (null != reader) {
try {
reader.close();
- } catch (Throwable e) {
+ } catch (final Throwable e) {
//Ignore
}
}
@@ -540,7 +540,7 @@ public class NewLoaderLogic {
logger.info("Matched: " + url);
}
}
- } catch (IOException e1) {
+ } catch (final IOException e1) {
e1.printStackTrace();
logger.warning("Unable to search classpath for modules: Received Exception: " + e1.getClass().getName() + " " + e1.getMessage(), e1);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NoSuchProviderException.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NoSuchProviderException.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NoSuchProviderException.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/NoSuchProviderException.java Wed Feb 19 15:47:58 2014
@@ -23,7 +23,7 @@ import org.apache.openejb.OpenEJBExcepti
*/
public class NoSuchProviderException extends OpenEJBException {
- public NoSuchProviderException(String message) {
+ public NoSuchProviderException(final String message) {
super(message);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java Wed Feb 19 15:47:58 2014
@@ -75,12 +75,12 @@ public class OpenEJBDeploymentManager im
targetPaths = null;
}
- public OpenEJBDeploymentManager(Deployment deployment) throws DeploymentManagerCreationException {
+ public OpenEJBDeploymentManager(final Deployment deployment) throws DeploymentManagerCreationException {
this.deployment = deployment;
- Properties properties = deployment.getProperties();
+ final Properties properties = deployment.getProperties();
// locale - local used by the server
- String localeString = properties.getProperty("locale");
+ final String localeString = properties.getProperty("locale");
if (localeString != null) {
locale = new Locale(localeString);
} else {
@@ -88,19 +88,19 @@ public class OpenEJBDeploymentManager im
}
// dconfig.bean.version - dconfig bean version supported by the server
- String dconfigBeanVersionString = properties.getProperty("locale");
+ final String dconfigBeanVersionString = properties.getProperty("locale");
dconfigBeanVersion = OpenEJBDeploymentManager.parseDConfigBeanVersionType(dconfigBeanVersionString);
// target.* - known targets available on the server
// target.*.description - known targets available on the server
- SortedMap<String, Target> targets = new TreeMap<String, Target>();
- for (Iterator<Map.Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext();) {
- Map.Entry entry = iterator.next();
- String key = (String) entry.getKey();
- String targetName = (String) entry.getValue();
+ final SortedMap<String, Target> targets = new TreeMap<String, Target>();
+ for (final Iterator<Map.Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext();) {
+ final Map.Entry entry = iterator.next();
+ final String key = (String) entry.getKey();
+ final String targetName = (String) entry.getValue();
if (key.startsWith("target.") && !key.endsWith(".description")) {
- String targetDescription = properties.getProperty(key + ".description");
- TargetImpl target = new TargetImpl(targetName, targetDescription);
+ final String targetDescription = properties.getProperty(key + ".description");
+ final TargetImpl target = new TargetImpl(targetName, targetDescription);
targets.put(targetName, target);
}
}
@@ -116,7 +116,7 @@ public class OpenEJBDeploymentManager im
this.targets = Collections.unmodifiableSortedMap(targets);
targetPaths = new ArrayList<String>();
- for (String targetName : targets.keySet()) {
+ for (final String targetName : targets.keySet()) {
targetPaths.add(targetName + "/");
}
Collections.reverse(targetPaths);
@@ -136,112 +136,112 @@ public class OpenEJBDeploymentManager im
}
- public TargetModuleID[] getAvailableModules(ModuleType moduleType, Target[] targetList) throws TargetException {
+ public TargetModuleID[] getAvailableModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- String type = null;
+ final String type = null;
if (type != null) {
moduleType.toString();
}
- Set<String> targetModulesStrings = deployment.list(type, null, toTargetSet(targetList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
+ final Set<String> targetModulesStrings = deployment.list(type, null, toTargetSet(targetList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
return targetModules.toArray(new TargetModuleID[targetModules.size()]);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
throw new IllegalStateException("DeployerException while listing deployments", e);
}
}
- public TargetModuleID[] getNonRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException {
+ public TargetModuleID[] getNonRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- String type = null;
+ final String type = null;
if (type != null) {
moduleType.toString();
}
- Set<String> targetModulesStrings = deployment.list(type, "stopped", toTargetSet(targetList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
+ final Set<String> targetModulesStrings = deployment.list(type, "stopped", toTargetSet(targetList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
return targetModules.toArray(new TargetModuleID[targetModules.size()]);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
throw new IllegalStateException("DeployerException while listing deployments", e);
}
}
- public TargetModuleID[] getRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException {
+ public TargetModuleID[] getRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- String type = null;
+ final String type = null;
if (type != null) {
moduleType.toString();
}
- Set<String> targetModulesStrings = deployment.list(type, "running", toTargetSet(targetList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
+ final Set<String> targetModulesStrings = deployment.list(type, "running", toTargetSet(targetList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModulesStrings);
return targetModules.toArray(new TargetModuleID[targetModules.size()]);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
throw new IllegalStateException("DeployerException while listing deployments", e);
}
}
- public ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan) {
+ public ProgressObject distribute(final Target[] targetList, final File moduleArchive, final File deploymentPlan) {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
// todo merge files
try {
- Set<String> targetModuleStrings = deployment.deploy(toTargetSet(targetList), moduleArchive);
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
+ final Set<String> targetModuleStrings = deployment.deploy(toTargetSet(targetList), moduleArchive);
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
return new ProgressObjectImpl(CommandType.DISTRIBUTE, targetModules);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
return new ProgressObjectImpl(CommandType.DISTRIBUTE, e);
}
}
- public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) {
+ public ProgressObject distribute(final Target[] targetList, final InputStream moduleArchive, final InputStream deploymentPlan) {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
// todo merge files
try {
- Set<String> targetModuleStrings = deployment.deploy(toTargetSet(targetList), null);
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
+ final Set<String> targetModuleStrings = deployment.deploy(toTargetSet(targetList), null);
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
return new ProgressObjectImpl(CommandType.DISTRIBUTE, targetModules);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
return new ProgressObjectImpl(CommandType.DISTRIBUTE, e);
}
}
- public ProgressObject start(TargetModuleID[] moduleIdList) {
+ public ProgressObject start(final TargetModuleID[] moduleIdList) {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- Set<String> targetModuleStrings = deployment.start(toModuleSet(moduleIdList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
+ final Set<String> targetModuleStrings = deployment.start(toModuleSet(moduleIdList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
return new ProgressObjectImpl(CommandType.START, targetModules);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
return new ProgressObjectImpl(CommandType.START, e);
}
}
- public ProgressObject stop(TargetModuleID[] moduleIdList) {
+ public ProgressObject stop(final TargetModuleID[] moduleIdList) {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- Set<String> targetModuleStrings = deployment.stop(toModuleSet(moduleIdList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
+ final Set<String> targetModuleStrings = deployment.stop(toModuleSet(moduleIdList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
return new ProgressObjectImpl(CommandType.STOP, targetModules);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
return new ProgressObjectImpl(CommandType.STOP, e);
}
}
- public ProgressObject undeploy(TargetModuleID[] moduleIdList) {
+ public ProgressObject undeploy(final TargetModuleID[] moduleIdList) {
if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
try {
- Set<String> targetModuleStrings = deployment.undeploy(toModuleSet(moduleIdList));
- Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
+ final Set<String> targetModuleStrings = deployment.undeploy(toModuleSet(moduleIdList));
+ final Set<TargetModuleID> targetModules = toTargetModuleIds(targetModuleStrings);
return new ProgressObjectImpl(CommandType.UNDEPLOY, targetModules);
- } catch (DeploymentException e) {
+ } catch (final DeploymentException e) {
return new ProgressObjectImpl(CommandType.UNDEPLOY, e);
}
}
@@ -250,11 +250,11 @@ public class OpenEJBDeploymentManager im
return false;
}
- public ProgressObject redeploy(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan) {
+ public ProgressObject redeploy(final TargetModuleID[] moduleIDList, final File moduleArchive, final File deploymentPlan) {
throw new UnsupportedOperationException("redeploy is not supported");
}
- public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) {
+ public ProgressObject redeploy(final TargetModuleID[] moduleIDList, final InputStream moduleArchive, final InputStream deploymentPlan) {
throw new UnsupportedOperationException("redeploy is not supported");
}
@@ -270,11 +270,11 @@ public class OpenEJBDeploymentManager im
return locale;
}
- public boolean isLocaleSupported(Locale locale) {
+ public boolean isLocaleSupported(final Locale locale) {
return getDefaultLocale().equals(locale);
}
- public void setLocale(Locale locale) {
+ public void setLocale(final Locale locale) {
if (!isLocaleSupported(locale)) {
throw new UnsupportedOperationException("Unsupported locale");
}
@@ -284,22 +284,22 @@ public class OpenEJBDeploymentManager im
return dconfigBeanVersion;
}
- public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version) {
+ public boolean isDConfigBeanVersionSupported(final DConfigBeanVersionType version) {
return dconfigBeanVersion.equals(version);
}
- public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException {
+ public void setDConfigBeanVersion(final DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException {
if (!isDConfigBeanVersionSupported(version)) {
throw new DConfigBeanVersionUnsupportedException("Version not supported " + version);
}
}
- public DeploymentConfiguration createConfiguration(DeployableObject deployableObject) throws InvalidModuleException {
+ public DeploymentConfiguration createConfiguration(final DeployableObject deployableObject) throws InvalidModuleException {
throw new InvalidModuleException("Not supported: " + deployableObject.getType());
}
- private Target getTargetFor(String moduleId) {
- for (String targetName : targetPaths) {
+ private Target getTargetFor(final String moduleId) {
+ for (final String targetName : targetPaths) {
if (moduleId.startsWith(moduleId)) {
return targets.get(targetName);
}
@@ -307,13 +307,13 @@ public class OpenEJBDeploymentManager im
return null;
}
- private Set<TargetModuleID> toTargetModuleIds(Set<String> modules) {
- Set<TargetModuleID> targetModuleIds = new HashSet<TargetModuleID>();
- for (String module : modules) {
+ private Set<TargetModuleID> toTargetModuleIds(final Set<String> modules) {
+ final Set<TargetModuleID> targetModuleIds = new HashSet<TargetModuleID>();
+ for (final String module : modules) {
String moduleId;
- String webUrl;
+ final String webUrl;
- int spaceIndex = module.indexOf(' ');
+ final int spaceIndex = module.indexOf(' ');
if (spaceIndex > 1) {
moduleId = module.substring(0, spaceIndex);
webUrl = module.substring(spaceIndex + 1);
@@ -331,7 +331,7 @@ public class OpenEJBDeploymentManager im
target = defaultTarget;
}
- TargetModuleIDImpl targetModuleID = new TargetModuleIDImpl(target, moduleId, webUrl);
+ final TargetModuleIDImpl targetModuleID = new TargetModuleIDImpl(target, moduleId, webUrl);
targetModuleIds.add(targetModuleID);
}
@@ -340,36 +340,36 @@ public class OpenEJBDeploymentManager im
return targetModuleIds;
}
- private Set<String> toTargetSet(Target[] targets) {
+ private Set<String> toTargetSet(final Target[] targets) {
if (targets == null) return Collections.emptySet();
- TreeSet<String> targetSet = new TreeSet<String>();
- for (Target target : targets) {
+ final TreeSet<String> targetSet = new TreeSet<String>();
+ for (final Target target : targets) {
targetSet.add(target.getName());
}
return targetSet;
}
- private Set<String> toModuleSet(TargetModuleID[] moduleIDList) {
+ private Set<String> toModuleSet(final TargetModuleID[] moduleIDList) {
if (moduleIDList == null) return Collections.emptySet();
- TreeSet<String> moduleSet = new TreeSet<String>();
- for (TargetModuleID module : moduleIDList) {
+ final TreeSet<String> moduleSet = new TreeSet<String>();
+ for (final TargetModuleID module : moduleIDList) {
moduleSet.add(module.getTarget().getName() + "/" + module.getModuleID());
}
return moduleSet;
}
- public static DConfigBeanVersionType parseDConfigBeanVersionType(String string) throws DeploymentManagerCreationException {
+ public static DConfigBeanVersionType parseDConfigBeanVersionType(final String string) throws DeploymentManagerCreationException {
if (string == null) {
return OpenEJBDeploymentManager.DEFAULT_DCONFIG_BEAN_VERSION;
}
try {
- Field field = DConfigBeanVersionType.class.getField(string);
+ final Field field = DConfigBeanVersionType.class.getField(string);
if (field.getType().equals(DConfigBeanVersionType.class) && Modifier.isStatic(field.getModifiers())) {
return (DConfigBeanVersionType) field.get(null);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// no-op
}
throw new DeploymentManagerCreationException("Unknown DConfig bean version: " + string);
@@ -380,11 +380,11 @@ public class OpenEJBDeploymentManager im
private final String name;
private final String description;
- public TargetImpl(String name) {
+ public TargetImpl(final String name) {
this(name, null);
}
- public TargetImpl(String name, String description) {
+ public TargetImpl(final String name, final String description) {
if (name == null) throw new NullPointerException("name is null");
this.name = name;
this.description = description;
@@ -402,11 +402,11 @@ public class OpenEJBDeploymentManager im
return name;
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (!(o instanceof TargetImpl)) return false;
- TargetImpl target = (TargetImpl) o;
+ final TargetImpl target = (TargetImpl) o;
return name.equals(target.name);
}
@@ -414,8 +414,8 @@ public class OpenEJBDeploymentManager im
return name.hashCode();
}
- public int compareTo(Object o) {
- TargetImpl target = (TargetImpl) o;
+ public int compareTo(final Object o) {
+ final TargetImpl target = (TargetImpl) o;
return name.compareTo(target.name);
}
}
@@ -429,11 +429,11 @@ public class OpenEJBDeploymentManager im
private TargetModuleID parentTargetModuleId;
private Set<TargetModuleID> children = new TreeSet<TargetModuleID>();
- public TargetModuleIDImpl(Target target, String moduleId) {
+ public TargetModuleIDImpl(final Target target, final String moduleId) {
this(target, moduleId, null);
}
- public TargetModuleIDImpl(Target target, String moduleId, String webUrl) {
+ public TargetModuleIDImpl(final Target target, final String moduleId, final String webUrl) {
if (target == null) throw new NullPointerException("target is null");
if (moduleId == null) throw new NullPointerException("moduleId is null");
this.target = target;
@@ -453,7 +453,7 @@ public class OpenEJBDeploymentManager im
return parentTargetModuleId;
}
- public void setParentTargetModuleID(TargetModuleIDImpl parentTargetModuleId) {
+ public void setParentTargetModuleID(final TargetModuleIDImpl parentTargetModuleId) {
this.parentTargetModuleId = parentTargetModuleId;
parentTargetModuleId.children.add(this);
}
@@ -470,11 +470,11 @@ public class OpenEJBDeploymentManager im
return target + "/" + moduleId + (webUrl == null ? " " : webUrl);
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (!(o instanceof TargetModuleIDImpl)) return false;
- TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
+ final TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
return target.equals(targetModuleID.target) &&
moduleId.equals(targetModuleID.moduleId);
}
@@ -486,11 +486,11 @@ public class OpenEJBDeploymentManager im
return result;
}
- public int compareTo(Object o) {
- TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
+ public int compareTo(final Object o) {
+ final TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
// compare target name
- int val = target.getName().compareTo(targetModuleID.target.getName());
+ final int val = target.getName().compareTo(targetModuleID.target.getName());
if (val != 0) return val;
// compare moduleId
@@ -503,13 +503,13 @@ public class OpenEJBDeploymentManager im
private final ProgressEvent event;
private final DeploymentStatus deploymentStatus;
- public ProgressObjectImpl(CommandType command, Set<TargetModuleID> targetModuleIds) {
+ public ProgressObjectImpl(final CommandType command, final Set<TargetModuleID> targetModuleIds) {
this.targetModuleIds = targetModuleIds;
deploymentStatus = new DeploymentStatusImpl(command);
event = new ProgressEvent(this, null, deploymentStatus);
}
- public ProgressObjectImpl(CommandType command, Exception exception) {
+ public ProgressObjectImpl(final CommandType command, final Exception exception) {
this.targetModuleIds = null;
deploymentStatus = new DeploymentStatusImpl(command, exception);
event = new ProgressEvent(this, null, deploymentStatus);
@@ -523,7 +523,7 @@ public class OpenEJBDeploymentManager im
return deploymentStatus;
}
- public ClientConfiguration getClientConfiguration(TargetModuleID id) {
+ public ClientConfiguration getClientConfiguration(final TargetModuleID id) {
return null;
}
@@ -543,11 +543,11 @@ public class OpenEJBDeploymentManager im
throw new OperationUnsupportedException("stop is not supported");
}
- public void addProgressListener(ProgressListener pol) {
+ public void addProgressListener(final ProgressListener pol) {
pol.handleProgressEvent(event);
}
- public void removeProgressListener(ProgressListener pol) {
+ public void removeProgressListener(final ProgressListener pol) {
}
}
@@ -557,17 +557,17 @@ public class OpenEJBDeploymentManager im
private final StateType state;
private final String message;
- public DeploymentStatusImpl(CommandType command) {
+ public DeploymentStatusImpl(final CommandType command) {
this.command = command;
this.state = StateType.COMPLETED;
this.message = null;
}
- public DeploymentStatusImpl(CommandType command, Exception exception) {
+ public DeploymentStatusImpl(final CommandType command, final Exception exception) {
this.command = command;
this.state = StateType.FAILED;
- StringWriter writer = new StringWriter();
+ final StringWriter writer = new StringWriter();
exception.printStackTrace(new PrintWriter(writer, true));
this.message = writer.toString();
}
@@ -601,7 +601,7 @@ public class OpenEJBDeploymentManager im
}
public String toString() {
- StringBuilder buf = new StringBuilder();
+ final StringBuilder buf = new StringBuilder();
buf.append("DeploymentStatus[").append(command).append(',');
buf.append(state);
if (message != null) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEjb2Conversion.java Wed Feb 19 15:47:58 2014
@@ -94,14 +94,14 @@ public class OpenEjb2Conversion implemen
if (altDD instanceof String) {
try {
altDD = JaxbOpenejbJar2.unmarshal(OpenejbJarType.class, new ByteArrayInputStream(((String) altDD).getBytes()), false);
- } catch (Exception e) {
+ } catch (final Exception e) {
// todo warn about not being able to parse sun descriptor
}
}
if (altDD instanceof URL) {
try {
altDD = JaxbOpenejbJar2.unmarshal(OpenejbJarType.class, IO.read((URL) altDD), false);
- } catch (Exception e) {
+ } catch (final Exception e) {
// todo warn about not being able to parse sun descriptor
}
}
@@ -285,7 +285,7 @@ public class OpenEjb2Conversion implemen
for (final Entity entity : entityMappings.getEntity()) {
try {
entities.put(entity.getDescription(), new EntityData(entity));
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
LoggerFactory.getLogger(this.getClass()).error(e.getMessage(), e);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java Wed Feb 19 15:47:58 2014
@@ -98,12 +98,12 @@ public class OutputGeneratedDescriptors
final Marshaller marshaller = ctx.createMarshaller();
marshaller.marshal(connector, out);
logger.info("Dumping Generated ra.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
- } catch (IOException e) {
+ } catch (final IOException e) {
// no-op
}
}
@@ -120,7 +120,7 @@ public class OutputGeneratedDescriptors
} else {
try {
return File.createTempFile(start, end);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
final File tmp = new File("tmp");
if (!tmp.exists() && !tmp.mkdirs()) {
@@ -143,13 +143,13 @@ public class OutputGeneratedDescriptors
try {
JpaJaxbUtil.marshal(Persistence.class, persistence, out);
logger.info("Dumping Generated CMP persistence.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
}
- } catch (IOException e) {
+ } catch (final IOException e) {
// no-op
}
}
@@ -159,12 +159,12 @@ public class OutputGeneratedDescriptors
try {
JpaJaxbUtil.marshal(EntityMappings.class, appModule.getCmpMappings(), out);
logger.info("Dumping Generated CMP mappings.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
- } catch (IOException e) {
+ } catch (final IOException e) {
// no-op
}
}
@@ -185,12 +185,12 @@ public class OutputGeneratedDescriptors
try {
JaxbOpenejbJar3.marshal(OpenejbJar.class, openejbJar, out);
logger.info("Dumping Generated openejb-jar.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// no-op
}
}
@@ -207,12 +207,12 @@ public class OutputGeneratedDescriptors
try {
JaxbOpenejbJar2.marshal(GeronimoEjbJarType.class, geronimoEjbJarType, out);
logger.info("Dumping Generated geronimo-openejb.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// no-op
}
}
@@ -226,12 +226,12 @@ public class OutputGeneratedDescriptors
try {
EjbJarXml.marshal(ejbJar, out);
logger.info("Dumping Generated ejb-jar.xml to: " + tempFile.getAbsolutePath());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
// no-op
} finally {
IO.close(out);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// no-op
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java Wed Feb 19 15:47:58 2014
@@ -41,7 +41,7 @@ public class PersistenceContextAnnFactor
boolean isPersistenceContextAnnotationValid = false;
try {
// Tomcat persistence context class is missing the properties method
- Class<?> persistenceContextClass = Class.forName("javax.persistence.PersistenceContext");
+ final Class<?> persistenceContextClass = Class.forName("javax.persistence.PersistenceContext");
persistenceContextClass.getMethod("properties", (Class[]) null);
isPersistenceContextAnnotationValid = true;
} catch (final Exception e) {
@@ -53,22 +53,22 @@ public class PersistenceContextAnnFactor
public Map<String, AsmPersistenceContext> contexts = new HashMap<String, AsmPersistenceContext>();
private final Set<String> processed = new HashSet<String>();
- public void addAnnotations(Class c) throws OpenEJBException {
+ public void addAnnotations(final Class c) throws OpenEJBException {
if (!useAsm) return;
if (processed.contains(c.getName())) return;
try {
- URL u = c.getResource("/" + c.getName().replace('.', '/') + ".class");
- ClassReader r = new ClassReader(IO.read(u));
+ final URL u = c.getResource("/" + c.getName().replace('.', '/') + ".class");
+ final ClassReader r = new ClassReader(IO.read(u));
r.accept(new PersistenceContextReader(contexts), ClassReader.SKIP_DEBUG);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new OpenEJBException("Unable to read class " + c.getName());
}
processed.add(c.getName());
}
- public PersistenceContextAnn create(PersistenceContext persistenceContext, AnnotationDeployer.Member member) throws OpenEJBException {
+ public PersistenceContextAnn create(final PersistenceContext persistenceContext, final AnnotationDeployer.Member member) throws OpenEJBException {
if (useAsm) {
if (member != null) {
addAnnotations(member.getDeclaringClass());
@@ -79,7 +79,7 @@ public class PersistenceContextAnnFactor
name = member == null ? null : member.getDeclaringClass().getName() + "/" + member.getName();
}
- AsmPersistenceContext asmPersistenceContext = contexts.get(name);
+ final AsmPersistenceContext asmPersistenceContext = contexts.get(name);
if (asmPersistenceContext == null) {
throw new NullPointerException("PersistenceContext " + name + " not found");
}
@@ -93,7 +93,7 @@ public class PersistenceContextAnnFactor
private final PersistenceContext persistenceContext;
- public DirectPersistenceContext(PersistenceContext persistenceContext) {
+ public DirectPersistenceContext(final PersistenceContext persistenceContext) {
if (persistenceContext == null) throw new NullPointerException("persistenceContext is null");
this.persistenceContext = persistenceContext;
}
@@ -112,8 +112,8 @@ public class PersistenceContextAnnFactor
}
public Map<String, String> properties() {
- Map<String, String> properties = new LinkedHashMap<String, String>();
- for (PersistenceProperty property : persistenceContext.properties()) {
+ final Map<String, String> properties = new LinkedHashMap<String, String>();
+ for (final PersistenceProperty property : persistenceContext.properties()) {
properties.put(property.name(), property.value());
}
return properties;
@@ -156,21 +156,21 @@ public class PersistenceContextAnnFactor
private String currentName;
private final Map<String, AsmPersistenceContext> contexts;
- private PersistenceContextReader(Map<String, AsmPersistenceContext> contexts) {
+ private PersistenceContextReader(final Map<String, AsmPersistenceContext> contexts) {
this.contexts = contexts;
}
- public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+ public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) {
className = name.replace("/", ".");
super.visit(version, access, name, signature, superName, interfaces);
}
- public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ public FieldVisitor visitField(final int access, final String name, final String desc, final String signature, final Object value) {
currentName = name;
return super.visitField(access, name, desc, signature, value);
}
- public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
currentName = name;
// setFoo -> foo
@@ -184,12 +184,12 @@ public class PersistenceContextAnnFactor
return super.visitMethod(access, name, desc, signature, exceptions);
}
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
return visitAnnotation(null, desc);
}
@Override
- public AnnotationVisitor visitAnnotation(String name, String desc) {
+ public AnnotationVisitor visitAnnotation(final String name, final String desc) {
if ("Ljavax/persistence/PersistenceContext;".equals(desc)) {
return new PersistenceContextVisitor(className, currentName, contexts);
} else if ("Ljavax/persistence/PersistenceContexts;".equals(desc)) {
@@ -199,17 +199,17 @@ public class PersistenceContextAnnFactor
}
@Override
- public AnnotationVisitor visitArray(String string) {
+ public AnnotationVisitor visitArray(final String string) {
return annotationVisitor();
}
@Override
- public AnnotationVisitor visitMethodParameterAnnotation(int i, String string, boolean b) {
+ public AnnotationVisitor visitMethodParameterAnnotation(final int i, final String string, final boolean b) {
return new EmptyVisitor().annotationVisitor();
}
@Override
- public AnnotationVisitor visitParameterAnnotation(int i, String string, boolean b) {
+ public AnnotationVisitor visitParameterAnnotation(final int i, final String string, final boolean b) {
return new EmptyVisitor().annotationVisitor();
}
@@ -223,26 +223,26 @@ public class PersistenceContextAnnFactor
private final Map<String, AsmPersistenceContext> contexts;
private AsmPersistenceContext persistenceContext = new AsmPersistenceContext();
- public PersistenceContextVisitor(String className, String memberName, Map<String, AsmPersistenceContext> contexts) {
+ public PersistenceContextVisitor(final String className, final String memberName, final Map<String, AsmPersistenceContext> contexts) {
super(Opcodes.ASM4);
this.contexts = contexts;
persistenceContext.name = className + "/" + memberName;
}
- public void visit(String name, Object value) {
+ public void visit(final String name, final Object value) {
setValue(name, value == null ? null : value.toString());
}
- public void visitEnum(String name, String type, String value) {
+ public void visitEnum(final String name, final String type, final String value) {
setValue(name, value == null ? null : value.toString());
}
- public AnnotationVisitor visitAnnotation(String name, String desc) {
+ public AnnotationVisitor visitAnnotation(final String name, final String desc) {
setValue(name, desc);
return this;
}
- private void setValue(String name, String value) {
+ private void setValue(final String name, final String value) {
if ("name".equals(name)) {
persistenceContext.name = value;
} else if ("unitName".equals(name)) {
@@ -252,12 +252,12 @@ public class PersistenceContextAnnFactor
}
}
- public AnnotationVisitor visitArray(String string) {
+ public AnnotationVisitor visitArray(final String string) {
return new EmptyVisitor() {
private String name;
private String value;
- public void visit(String n, Object v) {
+ public void visit(final String n, final Object v) {
if ("name".equals(n)) {
name = v == null ? null : v.toString();
} else if ("value".equals(n)) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceModule.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceModule.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceModule.java Wed Feb 19 15:47:58 2014
@@ -47,7 +47,7 @@ public class PersistenceModule implement
return rootUrl;
}
- public void setRootUrl(String rootUrl) {
+ public void setRootUrl(final String rootUrl) {
this.rootUrl = rootUrl;
this.uri = URLs.uri(rootUrl);
}
@@ -56,7 +56,7 @@ public class PersistenceModule implement
return persistence;
}
- public void setPersistence(Persistence persistence) {
+ public void setPersistence(final Persistence persistence) {
this.persistence = persistence;
}
@@ -113,7 +113,7 @@ public class PersistenceModule implement
return false;
}
- public void setStandaloneModule(boolean isStandalone) {
+ public void setStandaloneModule(final boolean isStandalone) {
//do nothing
}
}