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 [10/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/EjbJarInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java Wed Feb 19 15:47:58 2014
@@ -116,31 +116,31 @@ public class EjbJarInfoBuilder {
private final List<String> securityRoles = new ArrayList<String>();
- public EjbJarInfo buildInfo(EjbModule jar) throws OpenEJBException {
+ public EjbJarInfo buildInfo(final EjbModule jar) throws OpenEJBException {
deploymentIds.clear();
securityRoles.clear();
final Map<String, EjbDeployment> ejbds = jar.getOpenejbJar().getDeploymentsByEjbName();
- int beansDeployed = jar.getOpenejbJar().getEjbDeploymentCount();
- int beansInEjbJar = jar.getEjbJar().getEnterpriseBeans().length;
+ final int beansDeployed = jar.getOpenejbJar().getEjbDeploymentCount();
+ final int beansInEjbJar = jar.getEjbJar().getEnterpriseBeans().length;
if (beansInEjbJar != beansDeployed) {
- for (EnterpriseBean bean : jar.getEjbJar().getEnterpriseBeans()) {
+ for (final EnterpriseBean bean : jar.getEjbJar().getEnterpriseBeans()) {
if (!ejbds.containsKey(bean.getEjbName())){
ConfigUtils.logger.warning("conf.0018", bean.getEjbName(), jar.getJarLocation());
}
}
- String message = messages.format("conf.0008", jar.getJarLocation(), "" + beansInEjbJar, "" + beansDeployed);
+ final String message = messages.format("conf.0008", jar.getJarLocation(), "" + beansInEjbJar, "" + beansDeployed);
logger.warning(message);
throw new OpenEJBException(message);
}
- Map<String, EnterpriseBeanInfo> infos = new HashMap<String, EnterpriseBeanInfo>();
- Map<String, EnterpriseBean> items = new HashMap<String, EnterpriseBean>();
+ final Map<String, EnterpriseBeanInfo> infos = new HashMap<String, EnterpriseBeanInfo>();
+ final Map<String, EnterpriseBean> items = new HashMap<String, EnterpriseBean>();
- EjbJarInfo ejbJar = new EjbJarInfo();
+ final EjbJarInfo ejbJar = new EjbJarInfo();
ejbJar.path = jar.getJarLocation();
ejbJar.moduleUri = jar.getModuleUri();
ejbJar.moduleId = jar.getModuleId();
@@ -155,8 +155,8 @@ public class EjbJarInfoBuilder {
ejbJar.properties.putAll(jar.getProperties());
ejbJar.properties.putAll(jar.getOpenejbJar().getProperties());
- for (EnterpriseBean bean : jar.getEjbJar().getEnterpriseBeans()) {
- EnterpriseBeanInfo beanInfo;
+ for (final EnterpriseBean bean : jar.getEjbJar().getEnterpriseBeans()) {
+ final EnterpriseBeanInfo beanInfo;
if (bean instanceof SessionBean) {
beanInfo = initSessionBean((SessionBean) bean, ejbJar, ejbds);
} else if (bean instanceof EntityBean) {
@@ -169,7 +169,7 @@ public class EjbJarInfoBuilder {
ejbJar.enterpriseBeans.add(beanInfo);
if (deploymentIds.contains(beanInfo.ejbDeploymentId)) {
- String message = messages.format("conf.0100", beanInfo.ejbDeploymentId, jar.getJarLocation(), beanInfo.ejbName);
+ final String message = messages.format("conf.0100", beanInfo.ejbDeploymentId, jar.getJarLocation(), beanInfo.ejbName);
logger.warning(message);
throw new OpenEJBException(message);
}
@@ -206,7 +206,7 @@ public class EjbJarInfoBuilder {
initMethodConcurrency(jar, ejbds, ejbJar);
initApplicationExceptions(jar, ejbJar);
- for (EnterpriseBeanInfo bean : ejbJar.enterpriseBeans) {
+ for (final EnterpriseBeanInfo bean : ejbJar.enterpriseBeans) {
resolveRoleLinks(bean, items.get(bean.ejbName));
}
}
@@ -233,43 +233,43 @@ public class EjbJarInfoBuilder {
return ejbJar;
}
- private void initJndiNames(Map<String, EjbDeployment> ejbds, EnterpriseBeanInfo info) {
- EjbDeployment deployment = ejbds.get(info.ejbName);
- if (deployment != null) for (Jndi jndi : deployment.getJndi()) {
- JndiNameInfo jndiNameInfo = new JndiNameInfo();
+ private void initJndiNames(final Map<String, EjbDeployment> ejbds, final EnterpriseBeanInfo info) {
+ final EjbDeployment deployment = ejbds.get(info.ejbName);
+ if (deployment != null) for (final Jndi jndi : deployment.getJndi()) {
+ final JndiNameInfo jndiNameInfo = new JndiNameInfo();
jndiNameInfo.intrface = jndi.getInterface();
jndiNameInfo.name = jndi.getName();
info.jndiNamess.add(jndiNameInfo);
}
}
- private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
- for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
- Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
- EjbRelationshipRole left = iterator.next();
- EjbRelationshipRole right = iterator.next();
+ private void initRelationships(final EjbModule jar, final Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
+ for (final EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
+ final Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
+ final EjbRelationshipRole left = iterator.next();
+ final EjbRelationshipRole right = iterator.next();
// left role info
- CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
- CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
+ final CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
+ final CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
rightCmrFieldInfo.mappedBy = leftCmrFieldInfo;
}
}
- private CmrFieldInfo initRelationshipRole(EjbRelationshipRole role, EjbRelationshipRole relatedRole, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
- CmrFieldInfo cmrFieldInfo = new CmrFieldInfo();
+ private CmrFieldInfo initRelationshipRole(final EjbRelationshipRole role, final EjbRelationshipRole relatedRole, final Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
+ final CmrFieldInfo cmrFieldInfo = new CmrFieldInfo();
// find the entityBeanInfo info for this role
- String ejbName = role.getRelationshipRoleSource().getEjbName();
- EnterpriseBeanInfo enterpriseBeanInfo = infos.get(ejbName);
+ final String ejbName = role.getRelationshipRoleSource().getEjbName();
+ final EnterpriseBeanInfo enterpriseBeanInfo = infos.get(ejbName);
if (enterpriseBeanInfo == null) {
throw new OpenEJBException("Relation role source ejb not found " + ejbName);
}
if (!(enterpriseBeanInfo instanceof EntityBeanInfo)) {
throw new OpenEJBException("Relation role source ejb is not an entity bean " + ejbName);
}
- EntityBeanInfo entityBeanInfo = (EntityBeanInfo) enterpriseBeanInfo;
+ final EntityBeanInfo entityBeanInfo = (EntityBeanInfo) enterpriseBeanInfo;
cmrFieldInfo.roleSource = entityBeanInfo;
// RoleName: this may be null
@@ -289,15 +289,15 @@ public class EjbJarInfoBuilder {
cmrFieldInfo.fieldType = Collection.class.getName();
}
} else {
- String relatedEjbName = relatedRole.getRelationshipRoleSource().getEjbName();
- EnterpriseBeanInfo relatedEjb = infos.get(relatedEjbName);
+ final String relatedEjbName = relatedRole.getRelationshipRoleSource().getEjbName();
+ final EnterpriseBeanInfo relatedEjb = infos.get(relatedEjbName);
if (relatedEjb == null) {
throw new OpenEJBException("Relation role source ejb not found " + relatedEjbName);
}
if (!(relatedEjb instanceof EntityBeanInfo)) {
throw new OpenEJBException("Relation role source ejb is not an entity bean " + relatedEjbName);
}
- EntityBeanInfo relatedEntity = (EntityBeanInfo) relatedEjb;
+ final EntityBeanInfo relatedEntity = (EntityBeanInfo) relatedEjb;
relatedRole.getRelationshipRoleSource();
cmrFieldInfo.fieldName = relatedEntity.abstractSchemaName + "_" + relatedRole.getCmrField().getCmrFieldName();
@@ -317,13 +317,13 @@ public class EjbJarInfoBuilder {
return cmrFieldInfo;
}
- private void initInterceptors(EjbModule jar, EjbJarInfo ejbJar) throws OpenEJBException {
+ private void initInterceptors(final EjbModule jar, final EjbJarInfo ejbJar) throws OpenEJBException {
if (jar.getEjbJar().getInterceptors().length == 0) return;
if (jar.getEjbJar().getAssemblyDescriptor() == null) return;
if (jar.getEjbJar().getAssemblyDescriptor().getInterceptorBinding() == null) return;
- for (Interceptor s : jar.getEjbJar().getInterceptors()) {
- InterceptorInfo info = new InterceptorInfo();
+ for (final Interceptor s : jar.getEjbJar().getInterceptors()) {
+ final InterceptorInfo info = new InterceptorInfo();
info.clazz = s.getInterceptorClass();
@@ -344,8 +344,8 @@ public class EjbJarInfoBuilder {
ejbJar.interceptors.add(info);
}
- for (InterceptorBinding binding : jar.getEjbJar().getAssemblyDescriptor().getInterceptorBinding()) {
- InterceptorBindingInfo info = new InterceptorBindingInfo();
+ for (final InterceptorBinding binding : jar.getEjbJar().getAssemblyDescriptor().getInterceptorBinding()) {
+ final InterceptorBindingInfo info = new InterceptorBindingInfo();
info.ejbName = binding.getEjbName();
info.excludeClassInterceptors = binding.getExcludeClassInterceptors();
info.excludeDefaultInterceptors = binding.getExcludeDefaultInterceptors();
@@ -360,10 +360,10 @@ public class EjbJarInfoBuilder {
}
}
- private void initMethodTransactions(EjbModule jar, Map ejbds, EjbJarInfo ejbJarInfo) {
- List<ContainerTransaction> containerTransactions = jar.getEjbJar().getAssemblyDescriptor().getContainerTransaction();
- for (ContainerTransaction cTx : containerTransactions) {
- MethodTransactionInfo info = new MethodTransactionInfo();
+ private void initMethodTransactions(final EjbModule jar, final Map ejbds, final EjbJarInfo ejbJarInfo) {
+ final List<ContainerTransaction> containerTransactions = jar.getEjbJar().getAssemblyDescriptor().getContainerTransaction();
+ for (final ContainerTransaction cTx : containerTransactions) {
+ final MethodTransactionInfo info = new MethodTransactionInfo();
info.description = cTx.getDescription();
info.transAttribute = cTx.getTransAttribute().toString();
@@ -372,10 +372,10 @@ public class EjbJarInfoBuilder {
}
}
- private void initMethodConcurrency(EjbModule jar, Map ejbds, EjbJarInfo ejbJarInfo) {
- List<ContainerConcurrency> containerConcurrency = jar.getEjbJar().getAssemblyDescriptor().getContainerConcurrency();
- for (ContainerConcurrency att : containerConcurrency) {
- MethodConcurrencyInfo info = new MethodConcurrencyInfo();
+ private void initMethodConcurrency(final EjbModule jar, final Map ejbds, final EjbJarInfo ejbJarInfo) {
+ final List<ContainerConcurrency> containerConcurrency = jar.getEjbJar().getAssemblyDescriptor().getContainerConcurrency();
+ for (final ContainerConcurrency att : containerConcurrency) {
+ final MethodConcurrencyInfo info = new MethodConcurrencyInfo();
info.description = att.getDescription();
if (att.getLock() != null) {
@@ -388,35 +388,35 @@ public class EjbJarInfoBuilder {
}
}
- private void copyConcurrentMethods(SessionBean bean, EjbJarInfo ejbJarInfo, Map ejbds) {
- for (ConcurrentMethod method : bean.getConcurrentMethod()) {
- MethodConcurrencyInfo info = new MethodConcurrencyInfo();
+ private void copyConcurrentMethods(final SessionBean bean, final EjbJarInfo ejbJarInfo, final Map ejbds) {
+ for (final ConcurrentMethod method : bean.getConcurrentMethod()) {
+ final MethodConcurrencyInfo info = new MethodConcurrencyInfo();
if (method.getLock() != null) {
info.concurrencyAttribute = method.getLock().toString();
}
info.accessTimeout = toInfo(method.getAccessTimeout());
- Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
+ final Method m = new Method(bean.getEjbName(), null, method.getMethod().getMethodName());
m.setMethodParams(method.getMethod().getMethodParams());
info.methods.add(getMethodInfo(m, ejbds));
ejbJarInfo.methodConcurrency.add(info);
}
}
- private void copySchedules(List<Timer> timers, List<MethodScheduleInfo> scheduleInfos) {
- Map<NamedMethod, MethodScheduleInfo> methodScheduleInfoMap = new HashMap<NamedMethod, MethodScheduleInfo>();
- for (Timer timer : timers) {
- NamedMethod timeoutMethod = timer.getTimeoutMethod();
+ private void copySchedules(final List<Timer> timers, final List<MethodScheduleInfo> scheduleInfos) {
+ final Map<NamedMethod, MethodScheduleInfo> methodScheduleInfoMap = new HashMap<NamedMethod, MethodScheduleInfo>();
+ for (final Timer timer : timers) {
+ final NamedMethod timeoutMethod = timer.getTimeoutMethod();
MethodScheduleInfo methodScheduleInfo = methodScheduleInfoMap.get(timer.getTimeoutMethod());
if (methodScheduleInfo == null) {
methodScheduleInfo = new MethodScheduleInfo();
methodScheduleInfoMap.put(timeoutMethod, methodScheduleInfo);
methodScheduleInfo.method = toInfo(timeoutMethod);
}
- ScheduleInfo scheduleInfo = new ScheduleInfo();
+ final ScheduleInfo scheduleInfo = new ScheduleInfo();
//Copy TimerSchedule
- TimerSchedule timerSchedule = timer.getSchedule();
+ final TimerSchedule timerSchedule = timer.getSchedule();
if (timerSchedule != null) {
scheduleInfo.second = timerSchedule.getSecond();
scheduleInfo.minute = timerSchedule.getMinute();
@@ -445,9 +445,9 @@ public class EjbJarInfoBuilder {
scheduleInfos.addAll(methodScheduleInfoMap.values());
}
- private void initApplicationExceptions(EjbModule jar, EjbJarInfo ejbJarInfo) {
- for (ApplicationException applicationException : jar.getEjbJar().getAssemblyDescriptor().getApplicationException()) {
- ApplicationExceptionInfo info = new ApplicationExceptionInfo();
+ private void initApplicationExceptions(final EjbModule jar, final EjbJarInfo ejbJarInfo) {
+ for (final ApplicationException applicationException : jar.getEjbJar().getAssemblyDescriptor().getApplicationException()) {
+ final ApplicationExceptionInfo info = new ApplicationExceptionInfo();
info.exceptionClass = applicationException.getExceptionClass();
info.rollback = applicationException.isRollback();
info.inherited = applicationException.isInherited();
@@ -455,12 +455,12 @@ public class EjbJarInfoBuilder {
}
}
- private void initSecurityRoles(EjbModule jar, EjbJarInfo ejbJarInfo) {
+ private void initSecurityRoles(final EjbModule jar, final EjbJarInfo ejbJarInfo) {
- List<SecurityRole> roles = jar.getEjbJar().getAssemblyDescriptor().getSecurityRole();
+ final List<SecurityRole> roles = jar.getEjbJar().getAssemblyDescriptor().getSecurityRole();
- for (SecurityRole sr : roles) {
- SecurityRoleInfo info = new SecurityRoleInfo();
+ for (final SecurityRole sr : roles) {
+ final SecurityRoleInfo info = new SecurityRoleInfo();
info.description = sr.getDescription();
info.roleName = sr.getRoleName();
@@ -474,12 +474,12 @@ public class EjbJarInfoBuilder {
}
}
- private void initMethodPermissions(EjbModule jar, Map ejbds, EjbJarInfo ejbJarInfo) {
+ private void initMethodPermissions(final EjbModule jar, final Map ejbds, final EjbJarInfo ejbJarInfo) {
- List<MethodPermission> methodPermissions = jar.getEjbJar().getAssemblyDescriptor().getMethodPermission();
+ final List<MethodPermission> methodPermissions = jar.getEjbJar().getAssemblyDescriptor().getMethodPermission();
- for (MethodPermission mp : methodPermissions) {
- MethodPermissionInfo info = new MethodPermissionInfo();
+ for (final MethodPermission mp : methodPermissions) {
+ final MethodPermissionInfo info = new MethodPermissionInfo();
info.description = mp.getDescription();
info.roleNames.addAll(mp.getRoleName());
@@ -490,25 +490,25 @@ public class EjbJarInfoBuilder {
}
}
- private void initExcludesList(EjbModule jar, Map ejbds, EjbJarInfo ejbJarInfo) {
+ private void initExcludesList(final EjbModule jar, final Map ejbds, final EjbJarInfo ejbJarInfo) {
- ExcludeList methodPermissions = jar.getEjbJar().getAssemblyDescriptor().getExcludeList();
+ final ExcludeList methodPermissions = jar.getEjbJar().getAssemblyDescriptor().getExcludeList();
- for (Method excludedMethod : methodPermissions.getMethod()) {
+ for (final Method excludedMethod : methodPermissions.getMethod()) {
ejbJarInfo.excludeList.add(getMethodInfo(excludedMethod, ejbds));
}
}
- private void resolveRoleLinks(EnterpriseBeanInfo bean, JndiConsumer item) {
+ private void resolveRoleLinks(final EnterpriseBeanInfo bean, final JndiConsumer item) {
if (!(item instanceof RemoteBean)) {
return;
}
- RemoteBean rb = (RemoteBean) item;
+ final RemoteBean rb = (RemoteBean) item;
- List<SecurityRoleRef> refs = rb.getSecurityRoleRef();
- for (SecurityRoleRef ref : refs) {
- SecurityRoleReferenceInfo info = new SecurityRoleReferenceInfo();
+ final List<SecurityRoleRef> refs = rb.getSecurityRoleRef();
+ for (final SecurityRoleRef ref : refs) {
+ final SecurityRoleReferenceInfo info = new SecurityRoleReferenceInfo();
info.description = ref.getDescription();
info.roleLink = ref.getRoleLink();
@@ -521,22 +521,22 @@ public class EjbJarInfoBuilder {
}
}
- private List<MethodInfo> getMethodInfos(List<Method> ms, Map ejbds) {
+ private List<MethodInfo> getMethodInfos(final List<Method> ms, final Map ejbds) {
if (ms == null) return Collections.emptyList();
- List<MethodInfo> mi = new ArrayList<MethodInfo>(ms.size());
- for (Method method : ms) {
- MethodInfo methodInfo = getMethodInfo(method, ejbds);
+ final List<MethodInfo> mi = new ArrayList<MethodInfo>(ms.size());
+ for (final Method method : ms) {
+ final MethodInfo methodInfo = getMethodInfo(method, ejbds);
mi.add(methodInfo);
}
return mi;
}
- private MethodInfo getMethodInfo(Method method, Map ejbds) {
- MethodInfo methodInfo = new MethodInfo();
+ private MethodInfo getMethodInfo(final Method method, final Map ejbds) {
+ final MethodInfo methodInfo = new MethodInfo();
- EjbDeployment d = (EjbDeployment) ejbds.get(method.getEjbName());
+ final EjbDeployment d = (EjbDeployment) ejbds.get(method.getEjbName());
methodInfo.description = method.getDescription();
methodInfo.ejbDeploymentId = d == null ?null:d.getDeploymentId();
@@ -551,19 +551,19 @@ public class EjbJarInfoBuilder {
methodInfo.className = "*";
}
- MethodParams mp = method.getMethodParams();
+ final MethodParams mp = method.getMethodParams();
if (mp != null) {
methodInfo.methodParams = mp.getMethodParam();
}
return methodInfo;
}
- private EnterpriseBeanInfo initSessionBean(SessionBean s, EjbJarInfo ejbJar, Map m) throws OpenEJBException {
+ private EnterpriseBeanInfo initSessionBean(final SessionBean s, final EjbJarInfo ejbJar, final Map m) throws OpenEJBException {
EnterpriseBeanInfo bean = null;
if (s.getSessionType() == SessionType.STATEFUL) {
bean = new StatefulBeanInfo();
- StatefulBeanInfo stateful = (StatefulBeanInfo) bean;
+ final StatefulBeanInfo stateful = (StatefulBeanInfo) bean;
copyCallbacks(s.getPostActivate(), stateful.postActivate);
copyCallbacks(s.getPrePassivate(), stateful.prePassivate);
@@ -572,15 +572,15 @@ public class EjbJarInfoBuilder {
copyCallbacks(s.getBeforeCompletion(), stateful.beforeCompletion);
copyCallbacks(s.getAfterCompletion(), stateful.afterCompletion);
- for (InitMethod initMethod : s.getInitMethod()) {
- InitMethodInfo init = new InitMethodInfo();
+ for (final InitMethod initMethod : s.getInitMethod()) {
+ final InitMethodInfo init = new InitMethodInfo();
init.beanMethod = toInfo(initMethod.getBeanMethod());
init.createMethod = toInfo(initMethod.getCreateMethod());
stateful.initMethods.add(init);
}
- for (RemoveMethod removeMethod : s.getRemoveMethod()) {
- RemoveMethodInfo remove = new RemoveMethodInfo();
+ for (final RemoveMethod removeMethod : s.getRemoveMethod()) {
+ final RemoveMethodInfo remove = new RemoveMethodInfo();
remove.beanMethod = toInfo(removeMethod.getBeanMethod());
remove.retainIfException = removeMethod.getRetainIfException();
stateful.removeMethods.add(remove);
@@ -590,7 +590,7 @@ public class EjbJarInfoBuilder {
} else if (s.getSessionType() == SessionType.MANAGED) {
bean = new ManagedBeanInfo();
- ManagedBeanInfo managed = (ManagedBeanInfo) bean;
+ final ManagedBeanInfo managed = (ManagedBeanInfo) bean;
if (s instanceof ManagedBean) { // this way we support managed beans in ejb-jar.xml (not in the spec but can be useful)
managed.hidden = ((ManagedBean) s).isHidden();
} else {
@@ -600,8 +600,8 @@ public class EjbJarInfoBuilder {
copyCallbacks(s.getPostActivate(), managed.postActivate);
copyCallbacks(s.getPrePassivate(), managed.prePassivate);
- for (RemoveMethod removeMethod : s.getRemoveMethod()) {
- RemoveMethodInfo remove = new RemoveMethodInfo();
+ for (final RemoveMethod removeMethod : s.getRemoveMethod()) {
+ final RemoveMethodInfo remove = new RemoveMethodInfo();
remove.beanMethod = toInfo(removeMethod.getBeanMethod());
remove.retainIfException = removeMethod.getRetainIfException();
managed.removeMethods.add(remove);
@@ -609,7 +609,7 @@ public class EjbJarInfoBuilder {
} else if (s.getSessionType() == SessionType.SINGLETON) {
bean = new SingletonBeanInfo();
- ConcurrencyManagementType type = s.getConcurrencyManagementType();
+ final ConcurrencyManagementType type = s.getConcurrencyManagementType();
bean.concurrencyType = type != null ? type.toString() : ConcurrencyManagementType.CONTAINER.toString();
bean.loadOnStartup = s.getInitOnStartup();
@@ -641,7 +641,7 @@ public class EjbJarInfoBuilder {
bean.asynchronousClasses.addAll(s.getAsynchronousClasses());
- EjbDeployment d = (EjbDeployment) m.get(s.getEjbName());
+ final EjbDeployment d = (EjbDeployment) m.get(s.getEjbName());
if (d == null) {
throw new OpenEJBException("No deployment information in openejb-jar.xml for bean "
+ s.getEjbName()
@@ -650,7 +650,7 @@ public class EjbJarInfoBuilder {
bean.ejbDeploymentId = d.getDeploymentId();
bean.containerId = d.getContainerId();
- Icon icon = s.getIcon();
+ final Icon icon = s.getIcon();
bean.largeIcon = icon == null ? null : icon.getLargeIcon();
bean.smallIcon = icon == null ? null : icon.getSmallIcon();
bean.description = s.getDescription();
@@ -665,7 +665,7 @@ public class EjbJarInfoBuilder {
bean.parents.addAll(s.getParents());
bean.businessLocal.addAll(s.getBusinessLocal());
bean.businessRemote.addAll(s.getBusinessRemote());
- TransactionType txType = s.getTransactionType();
+ final TransactionType txType = s.getTransactionType();
bean.transactionType = txType != null ?txType.toString(): TransactionType.CONTAINER.toString();
bean.serviceEndpoint = s.getServiceEndpoint();
bean.properties.putAll(d.getProperties());
@@ -677,9 +677,9 @@ public class EjbJarInfoBuilder {
return bean;
}
- private void copyAsynchronous(List<AsyncMethod> methods, List<NamedMethodInfo> methodInfos) {
- for (AsyncMethod asyncMethod : methods) {
- NamedMethodInfo info = new NamedMethodInfo();
+ private void copyAsynchronous(final List<AsyncMethod> methods, final List<NamedMethodInfo> methodInfos) {
+ for (final AsyncMethod asyncMethod : methods) {
+ final NamedMethodInfo info = new NamedMethodInfo();
info.methodName = asyncMethod.getMethodName();
if (asyncMethod.getMethodParams() != null) {
info.methodParams = asyncMethod.getMethodParams().getMethodParam();
@@ -688,17 +688,17 @@ public class EjbJarInfoBuilder {
}
}
- private TimeoutInfo toInfo(Timeout timeout) {
+ private TimeoutInfo toInfo(final Timeout timeout) {
if (timeout == null) return null;
- TimeoutInfo accessTimeout = new TimeoutInfo();
+ final TimeoutInfo accessTimeout = new TimeoutInfo();
accessTimeout.time = timeout.getTimeout();
accessTimeout.unit = timeout.getUnit().toString();
return accessTimeout;
}
- private EnterpriseBeanInfo initMessageBean(MessageDrivenBean mdb, Map m) throws OpenEJBException {
- MessageDrivenBeanInfo bean = new MessageDrivenBeanInfo();
+ private EnterpriseBeanInfo initMessageBean(final MessageDrivenBean mdb, final Map m) throws OpenEJBException {
+ final MessageDrivenBeanInfo bean = new MessageDrivenBeanInfo();
bean.timeoutMethod = toInfo(mdb.getTimeoutMethod());
copyCallbacks(mdb.getAroundTimeout(),bean.aroundTimeout);
@@ -709,7 +709,7 @@ public class EjbJarInfoBuilder {
copySchedules(mdb.getTimer(), bean.methodScheduleInfos);
- EjbDeployment d = (EjbDeployment) m.get(mdb.getEjbName());
+ final EjbDeployment d = (EjbDeployment) m.get(mdb.getEjbName());
if (d == null) {
throw new OpenEJBException("No deployment information in openejb-jar.xml for bean "
+ mdb.getEjbName()
@@ -718,14 +718,14 @@ public class EjbJarInfoBuilder {
bean.ejbDeploymentId = d.getDeploymentId();
bean.containerId = d.getContainerId();
- Icon icon = mdb.getIcon();
+ final Icon icon = mdb.getIcon();
bean.largeIcon = icon == null ? null : icon.getLargeIcon();
bean.smallIcon = icon == null ? null : icon.getSmallIcon();
bean.description = mdb.getDescription();
bean.displayName = mdb.getDisplayName();
bean.ejbClass = mdb.getEjbClass();
bean.ejbName = mdb.getEjbName();
- TransactionType txType = mdb.getTransactionType();
+ final TransactionType txType = mdb.getTransactionType();
bean.transactionType = txType != null ?txType.toString(): TransactionType.CONTAINER.toString();
bean.properties.putAll(d.getProperties());
@@ -735,7 +735,7 @@ public class EjbJarInfoBuilder {
bean.mdbInterface = "javax.jms.MessageListener";
}
- ResourceLink resourceLink = d.getResourceLink("openejb/destination");
+ final ResourceLink resourceLink = d.getResourceLink("openejb/destination");
if (resourceLink != null) {
bean.destinationId = resourceLink.getResId();
}
@@ -744,11 +744,11 @@ public class EjbJarInfoBuilder {
bean.activationProperties.put("destinationType", mdb.getMessageDestinationType());
}
- ActivationConfig activationConfig = mdb.getActivationConfig();
+ final ActivationConfig activationConfig = mdb.getActivationConfig();
if (activationConfig != null) {
- for (ActivationConfigProperty property : activationConfig.getActivationConfigProperty()) {
- String name = property.getActivationConfigPropertyName();
- String value = property.getActivationConfigPropertyValue();
+ for (final ActivationConfigProperty property : activationConfig.getActivationConfigProperty()) {
+ final String name = property.getActivationConfigPropertyName();
+ final String value = property.getActivationConfigPropertyValue();
bean.activationProperties.put(name, value);
}
}
@@ -756,10 +756,10 @@ public class EjbJarInfoBuilder {
return bean;
}
- private NamedMethodInfo toInfo(NamedMethod method) {
+ private NamedMethodInfo toInfo(final NamedMethod method) {
if (method == null) return null;
- NamedMethodInfo info = new NamedMethodInfo();
+ final NamedMethodInfo info = new NamedMethodInfo();
info.methodName = method.getMethodName();
@@ -770,19 +770,19 @@ public class EjbJarInfoBuilder {
return info;
}
- private void copyCallbacks(List<? extends CallbackMethod> from, List<CallbackInfo> to) {
- for (CallbackMethod callback : from) {
- CallbackInfo info = new CallbackInfo();
+ private void copyCallbacks(final List<? extends CallbackMethod> from, final List<CallbackInfo> to) {
+ for (final CallbackMethod callback : from) {
+ final CallbackInfo info = new CallbackInfo();
info.className = callback.getClassName();
info.method = callback.getMethodName();
to.add(info);
}
}
- private EnterpriseBeanInfo initEntityBean(EntityBean e, Map m) throws OpenEJBException {
- EntityBeanInfo bean = new EntityBeanInfo();
+ private EnterpriseBeanInfo initEntityBean(final EntityBean e, final Map m) throws OpenEJBException {
+ final EntityBeanInfo bean = new EntityBeanInfo();
- EjbDeployment d = (EjbDeployment) m.get(e.getEjbName());
+ final EjbDeployment d = (EjbDeployment) m.get(e.getEjbName());
if (d == null) {
throw new OpenEJBException("No deployment information in openejb-jar.xml for bean "
+ e.getEjbName()
@@ -791,7 +791,7 @@ public class EjbJarInfoBuilder {
bean.ejbDeploymentId = d.getDeploymentId();
bean.containerId = d.getContainerId();
- Icon icon = e.getIcon();
+ final Icon icon = e.getIcon();
bean.largeIcon = icon == null ? null : icon.getLargeIcon();
bean.smallIcon = icon == null ? null : icon.getSmallIcon();
bean.description = e.getDescription();
@@ -811,7 +811,7 @@ public class EjbJarInfoBuilder {
bean.reentrant = e.getReentrant() + "";
bean.properties.putAll(d.getProperties());
- CmpVersion cmpVersion = e.getCmpVersion();
+ final CmpVersion cmpVersion = e.getCmpVersion();
if (e.getPersistenceType() == PersistenceType.CONTAINER) {
if (cmpVersion != null && cmpVersion == CmpVersion.CMP1){
bean.cmpVersion = 1;
@@ -820,42 +820,42 @@ public class EjbJarInfoBuilder {
}
}
- List<CmpField> cmpFields = e.getCmpField();
- for (CmpField cmpField : cmpFields) {
+ final List<CmpField> cmpFields = e.getCmpField();
+ for (final CmpField cmpField : cmpFields) {
bean.cmpFieldNames.add(cmpField.getFieldName());
}
if (bean.persistenceType.equalsIgnoreCase("Container")) {
- for (Query q : e.getQuery()) {
- QueryInfo query = new QueryInfo();
+ for (final Query q : e.getQuery()) {
+ final QueryInfo query = new QueryInfo();
query.queryStatement = q.getEjbQl().trim();
- MethodInfo method = new MethodInfo();
+ final MethodInfo method = new MethodInfo();
method.ejbName = bean.ejbName;
method.className = "*";
- QueryMethod qm = q.getQueryMethod();
+ final QueryMethod qm = q.getQueryMethod();
method.methodName = qm.getMethodName();
if (qm.getMethodParams() != null) {
method.methodParams = qm.getMethodParams().getMethodParam();
}
query.method = method;
- ResultTypeMapping resultType = q.getResultTypeMapping();
+ final ResultTypeMapping resultType = q.getResultTypeMapping();
if (ResultTypeMapping.REMOTE.equals(resultType)) {
query.remoteResultType = true;
}
bean.queries.add(query);
}
- for (org.apache.openejb.jee.oejb3.Query q : d.getQuery()) {
- QueryInfo query = new QueryInfo();
+ for (final org.apache.openejb.jee.oejb3.Query q : d.getQuery()) {
+ final QueryInfo query = new QueryInfo();
query.description = q.getDescription();
query.queryStatement = q.getObjectQl().trim();
- MethodInfo method = new MethodInfo();
+ final MethodInfo method = new MethodInfo();
method.ejbName = bean.ejbName;
method.className = "*";
- org.apache.openejb.jee.oejb3.QueryMethod qm = q.getQueryMethod();
+ final org.apache.openejb.jee.oejb3.QueryMethod qm = q.getQueryMethod();
method.methodName = qm.getMethodName();
if (qm.getMethodParams() != null) {
method.methodParams = qm.getMethodParams().getMethodParam();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java Wed Feb 19 15:47:58 2014
@@ -50,15 +50,15 @@ public class EjbModule extends Module im
private ClientModule clientModule;
private ID id;
- public EjbModule(EjbJar ejbJar) {
+ public EjbModule(final EjbJar ejbJar) {
this(Thread.currentThread().getContextClassLoader(), null, ejbJar, null);
}
- public EjbModule(EjbJar ejbJar, OpenejbJar openejbJar) {
+ public EjbModule(final EjbJar ejbJar, final OpenejbJar openejbJar) {
this(Thread.currentThread().getContextClassLoader(), null, ejbJar, openejbJar);
}
- public EjbModule(ClassLoader classLoader, String moduleId, String jarURI, EjbJar ejbJar, OpenejbJar openejbJar) {
+ public EjbModule(final ClassLoader classLoader, final String moduleId, final String jarURI, final EjbJar ejbJar, final OpenejbJar openejbJar) {
if (classLoader == null) {
throw new NullPointerException("classLoader is null");
}
@@ -77,7 +77,7 @@ public class EjbModule extends Module im
this.validation = new ValidationContext(this);
}
- public EjbModule(ClassLoader classLoader, String jarURI, EjbJar ejbJar, OpenejbJar openejbJar) {
+ public EjbModule(final ClassLoader classLoader, final String jarURI, final EjbJar ejbJar, final OpenejbJar openejbJar) {
this(classLoader, null, jarURI, ejbJar, openejbJar);
}
@@ -85,7 +85,7 @@ public class EjbModule extends Module im
return beans;
}
- public void setBeans(Beans beans) {
+ public void setBeans(final Beans beans) {
this.beans = beans;
}
@@ -93,11 +93,11 @@ public class EjbModule extends Module im
return finder.get();
}
- public void setFinder(IAnnotationFinder finder) {
+ public void setFinder(final IAnnotationFinder finder) {
this.finder.set(finder);
}
- public EjbModule finder(IAnnotationFinder finder) {
+ public EjbModule finder(final IAnnotationFinder finder) {
this.finder.set(finder);
return this;
}
@@ -106,7 +106,7 @@ public class EjbModule extends Module im
return clientModule;
}
- public void setClientModule(ClientModule clientModule) {
+ public void setClientModule(final ClientModule clientModule) {
this.clientModule = clientModule;
if (clientModule != null) {
clientModule.setEjbModuleGenerated(true);
@@ -122,7 +122,7 @@ public class EjbModule extends Module im
return ejbJar;
}
- public void setEjbJar(EjbJar ejbJar) {
+ public void setEjbJar(final EjbJar ejbJar) {
this.ejbJar = ejbJar;
}
@@ -130,7 +130,7 @@ public class EjbModule extends Module im
return id.getLocation() != null ? id.getLocation().getAbsolutePath() : null;
}
- public void setJarLocation(String jarLocation) {
+ public void setJarLocation(final String jarLocation) {
this.id = new ID(openejbJar, ejbJar, id.getName(), new File(jarLocation), id.getUri(), this);
}
@@ -142,7 +142,7 @@ public class EjbModule extends Module im
return id.getLocation();
}
- public void setModuleId(String moduleId) {
+ public void setModuleId(final String moduleId) {
if (openejbJar == null) openejbJar = new OpenejbJar();
openejbJar.setModuleName(moduleId);
@@ -153,7 +153,7 @@ public class EjbModule extends Module im
return id.getUri();
}
- public void setModuleUri(URI moduleUri) {
+ public void setModuleUri(final URI moduleUri) {
this.id = new ID(openejbJar, ejbJar, id.getName(), id.getLocation(), moduleUri, this);
}
@@ -161,7 +161,7 @@ public class EjbModule extends Module im
return openejbJar;
}
- public void setOpenejbJar(OpenejbJar openejbJar) {
+ public void setOpenejbJar(final OpenejbJar openejbJar) {
this.openejbJar = openejbJar;
}
@@ -169,7 +169,7 @@ public class EjbModule extends Module im
return webservices;
}
- public void setWebservices(Webservices webservices) {
+ public void setWebservices(final Webservices webservices) {
this.webservices = webservices;
}
@@ -181,7 +181,7 @@ public class EjbModule extends Module im
return webapp;
}
- public void setWebapp(boolean webapp) {
+ public void setWebapp(final boolean webapp) {
this.webapp = webapp;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java Wed Feb 19 15:47:58 2014
@@ -55,37 +55,37 @@ public class EnvEntriesPropertiesDeploye
descriptorName = descriptor;
}
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
// ApplicationClient META-INF/env-entries.properties
- for (ClientModule module : appModule.getClientModules()) {
+ for (final ClientModule module : appModule.getClientModules()) {
if (module.getApplicationClient() == null) continue;
- for (Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
- EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
+ for (final Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
+ final EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
apply(module.getApplicationClient(), envEntry, "AppClient");
}
}
// WebModule META-INF/env-entries.properties
- for (WebModule webModule : appModule.getWebModules()) {
+ for (final WebModule webModule : appModule.getWebModules()) {
deploy(webModule);
}
// Resource Adapters do not have an ENC
// EjbJar META-INF/env-entries.properties
- for (EjbModule module : appModule.getEjbModules()) {
- for (Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
- EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
+ for (final EjbModule module : appModule.getEjbModules()) {
+ for (final Map.Entry<String, String> entry : getEnvEntries(module).entrySet()) {
+ final EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
// To override a specific ejb only
// the following format is used:
// <ejb-name>.name = value
if (envEntry.getName().contains(".")) {
String name = envEntry.getName();
- String ejbName = name.substring(0,name.indexOf('.'));
+ final String ejbName = name.substring(0,name.indexOf('.'));
name = name.substring(name.indexOf('.')+1);
- EnterpriseBean bean = module.getEjbJar().getEnterpriseBean(ejbName);
+ final EnterpriseBean bean = module.getEjbJar().getEnterpriseBean(ejbName);
if (bean != null){
// Set the new property name without the <ejb-name>. prefix
envEntry.setName(name);
@@ -94,7 +94,7 @@ public class EnvEntriesPropertiesDeploye
}
}
- for (EnterpriseBean bean : module.getEjbJar().getEnterpriseBeans()) {
+ for (final EnterpriseBean bean : module.getEjbJar().getEnterpriseBeans()) {
apply(bean, envEntry, bean.getEjbName());
}
}
@@ -103,15 +103,15 @@ public class EnvEntriesPropertiesDeploye
return appModule;
}
- public WebModule deploy(WebModule webModule) {
- for (Map.Entry<String, String> entry : getEnvEntries(webModule).entrySet()) {
- EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
+ public WebModule deploy(final WebModule webModule) {
+ for (final Map.Entry<String, String> entry : getEnvEntries(webModule).entrySet()) {
+ final EnvEntry envEntry = new EnvEntry(entry.getKey(), "java.lang.String", entry.getValue());
apply(webModule.getWebApp(), envEntry, "WebApp");
}
return webModule;
}
- private void apply(JndiConsumer bean, EnvEntry newEntry, String componentName) {
+ private void apply(final JndiConsumer bean, final EnvEntry newEntry, final String componentName) {
EnvEntry entry = bean.getEnvEntryMap().get(newEntry.getName());
if(entry == null){
entry = bean.getEnvEntryMap().get("java:comp/env/" + newEntry.getName());
@@ -130,7 +130,7 @@ public class EnvEntriesPropertiesDeploye
}
@SuppressWarnings({"unchecked"})
- private Map<String, String> getEnvEntries(DeploymentModule module) {
+ private Map<String, String> getEnvEntries(final DeploymentModule module) {
final Object value = module.getAltDDs().get(descriptorName);
if (value instanceof Map) {
return (Map<String, String>) value;
@@ -145,7 +145,7 @@ public class EnvEntriesPropertiesDeploye
final Properties envEntriesProps = IO.readProperties(propsUrl);
envEntriesProps.putAll(additionalEnvEntries);
return new HashMap(envEntriesProps);
- } catch (IOException e) {
+ } catch (final IOException e) {
log.error("envprops.notLoaded", e, module.getModuleId(), propsUrl.toExternalForm());
return Collections.emptyMap();
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java Wed Feb 19 15:47:58 2014
@@ -49,40 +49,40 @@ public class FinderFactory {
public static final String FORCE_LINK = "openejb.finder.force.link";
private static FinderFactory get() {
- FinderFactory factory = SystemInstance.get().getComponent(FinderFactory.class);
+ final FinderFactory factory = SystemInstance.get().getComponent(FinderFactory.class);
return factory != null ? factory: FinderFactory.factory;
}
- public static IAnnotationFinder createFinder(DeploymentModule module) throws Exception {
+ public static IAnnotationFinder createFinder(final DeploymentModule module) throws Exception {
return get().create(module);
}
- public static AnnotationFinder getFinder(ClassLoader classLoader, URL url) {
+ public static AnnotationFinder getFinder(final ClassLoader classLoader, final URL url) {
return newFinder(ClasspathArchive.archive(classLoader, url));
}
- public IAnnotationFinder create(DeploymentModule module) throws Exception {
+ public IAnnotationFinder create(final DeploymentModule module) throws Exception {
final AnnotationFinder finder;
if (module instanceof WebModule) {
- WebModule webModule = (WebModule) module;
+ final WebModule webModule = (WebModule) module;
final AnnotationFinder annotationFinder = newFinder(new WebappAggregatedArchive(webModule, webModule.getScannableUrls()));
enableFinderOptions(annotationFinder);
finder = annotationFinder;
} else if (module instanceof ConnectorModule) {
- ConnectorModule connectorModule = (ConnectorModule) module;
+ final ConnectorModule connectorModule = (ConnectorModule) module;
finder = newFinder(new ConfigurableClasspathArchive(connectorModule, connectorModule.getLibraries())).link();
} else if (module instanceof AppModule) {
final Collection<URL> urls = NewLoaderLogic.applyBuiltinExcludes(new UrlSet(AppModule.class.cast(module).getAdditionalLibraries())).getUrls();
finder = newFinder(new WebappAggregatedArchive(module.getClassLoader(), module.getAltDDs(), urls));
} else if (module.getJarLocation() != null) {
- String location = module.getJarLocation();
- File file = new File(location);
+ final String location = module.getJarLocation();
+ final File file = new File(location);
URL url;
if (file.exists()) {
url = file.toURI().toURL();
- File webInfClassesFolder = new File(file, "WEB-INF/classes"); // is it possible?? normally no
+ final File webInfClassesFolder = new File(file, "WEB-INF/classes"); // is it possible?? normally no
if (webInfClassesFolder.exists() && webInfClassesFolder.isDirectory()) {
url = webInfClassesFolder.toURI().toURL();
}
@@ -119,7 +119,7 @@ public class FinderFactory {
public static final class DebugArchive implements Archive {
private final Archive archive;
- private DebugArchive(Archive archive) {
+ private DebugArchive(final Archive archive) {
this.archive = archive;
}
@@ -129,12 +129,12 @@ public class FinderFactory {
}
@Override
- public InputStream getBytecode(String s) throws IOException, ClassNotFoundException {
+ public InputStream getBytecode(final String s) throws IOException, ClassNotFoundException {
return archive.getBytecode(s);
}
@Override
- public Class<?> loadClass(String s) throws ClassNotFoundException {
+ public Class<?> loadClass(final String s) throws ClassNotFoundException {
try {
return archive.loadClass(s);
} catch (final ClassNotFoundException e) {
@@ -144,7 +144,7 @@ public class FinderFactory {
}
}
- public static AnnotationFinder enableFinderOptions(AnnotationFinder annotationFinder) {
+ public static AnnotationFinder enableFinderOptions(final AnnotationFinder annotationFinder) {
if (annotationFinder.hasMetaAnnotations()) {
annotationFinder.enableMetaAnnotations();
}
@@ -153,7 +153,7 @@ public class FinderFactory {
return annotationFinder;
}
- private static void enableSubclassing(AnnotationFinder annotationFinder) {
+ private static void enableSubclassing(final AnnotationFinder annotationFinder) {
if (enableFindSubclasses()) {
// for @HandleTypes we need interface impl, impl of abstract classes too
annotationFinder.enableFindSubclasses();
@@ -171,7 +171,7 @@ public class FinderFactory {
try { // since Tomcat 7.0.47
FinderFactory.class.getClassLoader().loadClass("javax.websocket.Endpoint");
return true;
- } catch (Throwable e) {
+ } catch (final Throwable e) {
return false;
}
}
@@ -180,7 +180,7 @@ public class FinderFactory {
try {
FinderFactory.class.getClassLoader().loadClass("org.apache.openejb.server.rest.RsRegistry");
return true;
- } catch (Throwable e) {
+ } catch (final Throwable e) {
return false;
}
}
@@ -188,12 +188,12 @@ public class FinderFactory {
public static class ModuleLimitedFinder implements IAnnotationFinder {
private final IAnnotationFinder delegate;
- public ModuleLimitedFinder(IAnnotationFinder delegate) {
+ public ModuleLimitedFinder(final IAnnotationFinder delegate) {
this.delegate = delegate;
}
@Override
- public boolean isAnnotationPresent(Class<? extends Annotation> annotation) {
+ public boolean isAnnotationPresent(final Class<? extends Annotation> annotation) {
return delegate.isAnnotationPresent(annotation);
}
@@ -203,15 +203,15 @@ public class FinderFactory {
}
@Override
- public List<Package> findAnnotatedPackages(Class<? extends Annotation> annotation) {
+ public List<Package> findAnnotatedPackages(final Class<? extends Annotation> annotation) {
return delegate.findAnnotatedPackages(annotation);
}
@Override
- public List<Class<?>> findAnnotatedClasses(Class<? extends Annotation> annotation) {
+ public List<Class<?>> findAnnotatedClasses(final Class<? extends Annotation> annotation) {
try {
return filter(delegate.findAnnotatedClasses(annotation), new ClassPredicate<Object>(getAnnotatedClassNames()));
- } catch (TypeNotPresentException tnpe) {
+ } catch (final TypeNotPresentException tnpe) {
throw handleException(tnpe, annotation);
}
}
@@ -221,75 +221,75 @@ public class FinderFactory {
final Method mtd = AnnotationFinder.class.getDeclaredMethod("getAnnotationInfos", String.class);
mtd.setAccessible(true);
final List<?> infos = (List<?>) mtd.invoke(delegate);
- for (Object info : infos) {
+ for (final Object info : infos) {
if (info instanceof AnnotationFinder.ClassInfo) {
final AnnotationFinder.ClassInfo classInfo = (AnnotationFinder.ClassInfo) info;
try {
// can throw the exception
classInfo.get().isAnnotationPresent(annotation);
- } catch (TypeNotPresentException tnpe2) {
+ } catch (final TypeNotPresentException tnpe2) {
throw new OpenEJBRuntimeException("Missing type for annotation " + annotation.getName() + " on class " + classInfo.getName(), tnpe2);
- } catch (ThreadDeath ignored) {
+ } catch (final ThreadDeath ignored) {
// no-op
}
}
}
- } catch (Throwable th) {
+ } catch (final Throwable th) {
// no-op
}
return tnpe;
}
@Override
- public List<Class<?>> findInheritedAnnotatedClasses(Class<? extends Annotation> annotation) {
+ public List<Class<?>> findInheritedAnnotatedClasses(final Class<? extends Annotation> annotation) {
return filter(delegate.findInheritedAnnotatedClasses(annotation), new ClassPredicate<Object>(getAnnotatedClassNames()));
}
@Override
- public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation) {
+ public List<Method> findAnnotatedMethods(final Class<? extends Annotation> annotation) {
return filter(delegate.findAnnotatedMethods(annotation), new MethodPredicate(getAnnotatedClassNames()));
}
@Override
- public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation) {
+ public List<Constructor> findAnnotatedConstructors(final Class<? extends Annotation> annotation) {
return filter(delegate.findAnnotatedConstructors(annotation), new ConstructorPredicate(getAnnotatedClassNames()));
}
@Override
- public List<Field> findAnnotatedFields(Class<? extends Annotation> annotation) {
+ public List<Field> findAnnotatedFields(final Class<? extends Annotation> annotation) {
return filter(delegate.findAnnotatedFields(annotation), new FieldPredicate(getAnnotatedClassNames()));
}
@Override
- public List<Class<?>> findClassesInPackage(String packageName, boolean recursive) {
+ public List<Class<?>> findClassesInPackage(final String packageName, final boolean recursive) {
return filter(delegate.findClassesInPackage(packageName, recursive), new ClassPredicate<Object>(getAnnotatedClassNames()));
}
@Override
- public <T> List<Class<? extends T>> findSubclasses(Class<T> clazz) {
+ public <T> List<Class<? extends T>> findSubclasses(final Class<T> clazz) {
return filter(delegate.findSubclasses(clazz), new ClassPredicate<T>(getAnnotatedClassNames()));
}
@Override
- public <T> List<Class<? extends T>> findImplementations(Class<T> clazz) {
+ public <T> List<Class<? extends T>> findImplementations(final Class<T> clazz) {
return filter(delegate.findImplementations(clazz), new ClassPredicate<T>(getAnnotatedClassNames()));
}
@Override
- public List<Annotated<Method>> findMetaAnnotatedMethods(Class<? extends Annotation> annotation) {
+ public List<Annotated<Method>> findMetaAnnotatedMethods(final Class<? extends Annotation> annotation) {
return filter(delegate.findMetaAnnotatedMethods(annotation), new AnnotatedMethodPredicate(getAnnotatedClassNames()));
}
@Override
- public List<Annotated<Field>> findMetaAnnotatedFields(Class<? extends Annotation> annotation) {
+ public List<Annotated<Field>> findMetaAnnotatedFields(final Class<? extends Annotation> annotation) {
return filter(delegate.findMetaAnnotatedFields(annotation), new AnnotatedFieldPredicate(getAnnotatedClassNames()));
}
@Override
- public List<Annotated<Class<?>>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation) {
+ public List<Annotated<Class<?>>> findMetaAnnotatedClasses(final Class<? extends Annotation> annotation) {
try {
return filter(delegate.findMetaAnnotatedClasses(annotation), new AnnotatedClassPredicate(getAnnotatedClassNames()));
- } catch (TypeNotPresentException tnpe) {
+ } catch (final TypeNotPresentException tnpe) {
throw handleException(tnpe, annotation);
}
}
@@ -301,7 +301,7 @@ public class FinderFactory {
private static <T> List<T> filter(final List<T> list, final Predicate<T> predicate) {
final List<T> ts = new ArrayList<T>();
- for (T t : list) {
+ for (final T t : list) {
if (predicate.accept(t)) {
ts.add(t);
}
@@ -320,7 +320,7 @@ public class FinderFactory {
accepted = list;
}
- protected boolean accept(T t) {
+ protected boolean accept(final T t) {
return accepted.contains(name(t));
}
@@ -333,7 +333,7 @@ public class FinderFactory {
}
@Override
- protected String name(Class<? extends T> aClass) {
+ protected String name(final Class<? extends T> aClass) {
return aClass.getName();
}
}
@@ -344,7 +344,7 @@ public class FinderFactory {
}
@Override
- protected String name(Method method) {
+ protected String name(final Method method) {
return method.getDeclaringClass().getName();
}
}
@@ -355,7 +355,7 @@ public class FinderFactory {
}
@Override
- protected String name(Field field) {
+ protected String name(final Field field) {
return field.getDeclaringClass().getName();
}
}
@@ -366,7 +366,7 @@ public class FinderFactory {
}
@Override
- protected String name(Constructor constructor) {
+ protected String name(final Constructor constructor) {
return constructor.getDeclaringClass().getName();
}
}
@@ -377,7 +377,7 @@ public class FinderFactory {
}
@Override
- protected String name(Annotated<Class<?>> aClass) {
+ protected String name(final Annotated<Class<?>> aClass) {
return aClass.get().getName();
}
}
@@ -388,7 +388,7 @@ public class FinderFactory {
}
@Override
- protected String name(Annotated<Method> method) {
+ protected String name(final Annotated<Method> method) {
return method.get().getDeclaringClass().getName();
}
}
@@ -399,7 +399,7 @@ public class FinderFactory {
}
@Override
- protected String name(Annotated<Field> field) {
+ protected String name(final Annotated<Field> field) {
return field.get().getDeclaringClass().getName();
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java Wed Feb 19 15:47:58 2014
@@ -45,8 +45,8 @@ public class GeneratedClientModules {
* Add the auto-generated and linked ClientModule from each EjbModule
*/
public static class Add implements DynamicDeployer {
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
if (ejbModule.getClientModule() != null) {
appModule.getClientModules().add(ejbModule.getClientModule());
ejbModule.setClientModule(null);
@@ -60,15 +60,15 @@ public class GeneratedClientModules {
* Clean up any that didn't turn out to have any actual ejb clients
*/
public static class Prune implements DynamicDeployer {
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
- List<ClientModule> clientModules = new ArrayList<ClientModule>(appModule.getClientModules());
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
+ final List<ClientModule> clientModules = new ArrayList<ClientModule>(appModule.getClientModules());
- for (ClientModule clientModule : clientModules) {
+ for (final ClientModule clientModule : clientModules) {
// we automatically add a ClientModule to every EjbModule
// if there didn't turn out to be any clients in the module
// just ingore it and remove it from the clientModule list
- boolean haveMainClassAndDescriptor = clientModule.getMainClass() != null && clientModule.getApplicationClient() != null;
- boolean haveAnnotatedClients = clientModule.getLocalClients().size() > 0 || clientModule.getRemoteClients().size() > 0;
+ final boolean haveMainClassAndDescriptor = clientModule.getMainClass() != null && clientModule.getApplicationClient() != null;
+ final boolean haveAnnotatedClients = clientModule.getLocalClients().size() > 0 || clientModule.getRemoteClients().size() > 0;
if (clientModule.isEjbModuleGenerated() && !haveMainClassAndDescriptor && !haveAnnotatedClients) {
appModule.getClientModules().remove(clientModule);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeronimoMappedName.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeronimoMappedName.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeronimoMappedName.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/GeronimoMappedName.java Wed Feb 19 15:47:58 2014
@@ -34,57 +34,57 @@ public class GeronimoMappedName implemen
private static final String MAPPED_NAME_PREFIX = "jndi:java:comp/geronimo/env/";
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
mapReferences(appModule);
return appModule;
}
- private void mapReferences(AppModule appModule) {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ private void mapReferences(final AppModule appModule) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
mapReferences(ejbModule.getEjbJar());
}
}
- private void mapReferences(EjbJar ejbJar) {
+ private void mapReferences(final EjbJar ejbJar) {
if (ejbJar == null){
return;
}
- for (EnterpriseBean enterpriseBean : ejbJar.getEnterpriseBeans()) {
- for (EjbRef ref : enterpriseBean.getEjbRef()) {
+ for (final EnterpriseBean enterpriseBean : ejbJar.getEnterpriseBeans()) {
+ for (final EjbRef ref : enterpriseBean.getEjbRef()) {
// remap only corba references
- String mappedName = ref.getMappedName();
+ final String mappedName = ref.getMappedName();
if (mappedName != null &&
(mappedName.startsWith("jndi:corbaloc") || mappedName.startsWith("jndi:corbaname"))) {
- String refName = ref.getEjbRefName();
+ final String refName = ref.getEjbRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
if (null == mappedName && ref.getEjbRefName().equals("ejb/MEJB")) {
ref.setMappedName("mejb/ejb/mgmt/MEJB");
}
}
- for (MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
- String refName = ref.getMessageDestinationRefName();
+ for (final MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
+ final String refName = ref.getMessageDestinationRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
- for (PersistenceContextRef ref : enterpriseBean.getPersistenceContextRef()) {
- String refName = ref.getPersistenceContextRefName();
+ for (final PersistenceContextRef ref : enterpriseBean.getPersistenceContextRef()) {
+ final String refName = ref.getPersistenceContextRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
- for (PersistenceUnitRef ref : enterpriseBean.getPersistenceUnitRef()) {
- String refName = ref.getPersistenceUnitRefName();
+ for (final PersistenceUnitRef ref : enterpriseBean.getPersistenceUnitRef()) {
+ final String refName = ref.getPersistenceUnitRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
- for (ResourceRef ref : enterpriseBean.getResourceRef()) {
- String refName = ref.getResRefName();
+ for (final ResourceRef ref : enterpriseBean.getResourceRef()) {
+ final String refName = ref.getResRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
- for (ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
- String refName = ref.getResourceEnvRefName();
+ for (final ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
+ final String refName = ref.getResourceEnvRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
- for (ServiceRef ref : enterpriseBean.getServiceRef()) {
- String refName = ref.getServiceRefName();
+ for (final ServiceRef ref : enterpriseBean.getServiceRef()) {
+ final String refName = ref.getServiceRefName();
ref.setMappedName(MAPPED_NAME_PREFIX + refName);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java Wed Feb 19 15:47:58 2014
@@ -42,18 +42,18 @@ public class InitEjbDeployments implemen
private static final String DEPLOYMENT_ID_FORMAT = "openejb.deploymentId.format";
public InitEjbDeployments() {
- String format = SystemInstance.get().getOptions().get(DEPLOYMENT_ID_FORMAT, "{ejbName}");
+ final String format = SystemInstance.get().getOptions().get(DEPLOYMENT_ID_FORMAT, "{ejbName}");
this.deploymentIdTemplate = new StringTemplate(format);
}
- public synchronized AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public synchronized AppModule deploy(final AppModule appModule) throws OpenEJBException {
- Set<String> abstractSchemaNames = new HashSet<String>();
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ final Set<String> abstractSchemaNames = new HashSet<String>();
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
if (isCmpEntity(bean)) {
- EntityBean entity = (EntityBean) bean;
- String name = entity.getAbstractSchemaName();
+ final EntityBean entity = (EntityBean) bean;
+ final String name = entity.getAbstractSchemaName();
if (name != null) {
abstractSchemaNames.add(name);
}
@@ -62,10 +62,10 @@ public class InitEjbDeployments implemen
}
- Map<String, String> contextData = new HashMap<String, String>();
+ final Map<String, String> contextData = new HashMap<String, String>();
contextData.put("appId", appModule.getModuleId());
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
contextData.put("ejbJarId", ejbModule.getModuleId());
deploy(ejbModule, contextData, abstractSchemaNames);
}
@@ -73,15 +73,15 @@ public class InitEjbDeployments implemen
return appModule;
}
- public EjbModule deploy(EjbModule ejbModule) throws OpenEJBException {
+ public EjbModule deploy(final EjbModule ejbModule) throws OpenEJBException {
return deploy(ejbModule, new HashMap<String,String>(), new HashSet<String>());
}
- private EjbModule deploy(EjbModule ejbModule, Map<String, String> contextData, Set<String> abstractSchemaNames) throws OpenEJBException {
+ private EjbModule deploy(final EjbModule ejbModule, final Map<String, String> contextData, final Set<String> abstractSchemaNames) throws OpenEJBException {
contextData.put("moduleId", ejbModule.getModuleId());
contextData.put("moduleUri", ejbModule.getModuleUri().toString());
- OpenejbJar openejbJar;
+ final OpenejbJar openejbJar;
if (ejbModule.getOpenejbJar() != null) {
openejbJar = ejbModule.getOpenejbJar();
} else {
@@ -91,16 +91,16 @@ public class InitEjbDeployments implemen
StringTemplate deploymentIdTemplate = this.deploymentIdTemplate;
if (openejbJar.getProperties().containsKey(DEPLOYMENT_ID_FORMAT)) {
- String format = openejbJar.getProperties().getProperty(DEPLOYMENT_ID_FORMAT);
+ final String format = openejbJar.getProperties().getProperty(DEPLOYMENT_ID_FORMAT);
logger.info("Using " + DEPLOYMENT_ID_FORMAT + " '" + format + "'");
deploymentIdTemplate = new StringTemplate(format);
}
- for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
StringTemplate template = deploymentIdTemplate;
- org.apache.openejb.api.EjbDeployment annotation = getEjbDeploymentAnnotation(ejbModule, bean);
+ final org.apache.openejb.api.EjbDeployment annotation = getEjbDeploymentAnnotation(ejbModule, bean);
EjbDeployment ejbDeployment = openejbJar.getDeploymentsByEjbName().get(bean.getEjbName());
if (ejbDeployment == null) {
@@ -135,7 +135,7 @@ public class InitEjbDeployments implemen
}
if (isCmpEntity(bean)) {
- EntityBean entity = (EntityBean) bean;
+ final EntityBean entity = (EntityBean) bean;
if (entity.getAbstractSchemaName() == null) {
String abstractSchemaName = bean.getEjbName().trim().replaceAll("[ \\t\\n\\r-]+", "_");
@@ -157,11 +157,11 @@ public class InitEjbDeployments implemen
return ejbModule;
}
- private org.apache.openejb.api.EjbDeployment getEjbDeploymentAnnotation(EjbModule ejbModule, EnterpriseBean bean) {
+ private org.apache.openejb.api.EjbDeployment getEjbDeploymentAnnotation(final EjbModule ejbModule, final EnterpriseBean bean) {
try {
- Class<?> beanClass = ejbModule.getClassLoader().loadClass(bean.getEjbClass());
+ final Class<?> beanClass = ejbModule.getClassLoader().loadClass(bean.getEjbClass());
return beanClass.getAnnotation(org.apache.openejb.api.EjbDeployment.class);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// this should never happen, the class has already been loaded a ton of times by this point
// unfortunately we have some unit tests that prevent us from throwing an exception just in case
// Those are OpenEjb2ConversionTest and SunCmpConversionTest
@@ -169,21 +169,21 @@ public class InitEjbDeployments implemen
}
}
- private boolean isDefined(String s) {
+ private boolean isDefined(final String s) {
return s != null && !"".equals(s);
}
- private static boolean isCmpEntity(EnterpriseBean bean) {
+ private static boolean isCmpEntity(final EnterpriseBean bean) {
return bean instanceof EntityBean && ((EntityBean) bean).getPersistenceType() == PersistenceType.CONTAINER;
}
- private String formatDeploymentId(EnterpriseBean bean, Map<String, String> contextData, StringTemplate template) {
+ private String formatDeploymentId(final EnterpriseBean bean, final Map<String, String> contextData, final StringTemplate template) {
contextData.put("ejbType", bean.getClass().getSimpleName());
contextData.put("ejbClass", bean.getEjbClass());
// we don't have the ejb class object (only the string name) so we have
// to extract the simple name from the FQN of the class
- int simpleNameIdx = bean.getEjbClass().lastIndexOf(".");
+ final int simpleNameIdx = bean.getEjbClass().lastIndexOf(".");
contextData.put("ejbClass.simpleName", bean.getEjbClass().substring(simpleNameIdx + 1));
contextData.put("ejbName", bean.getEjbName());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JPAPropertyConverter.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JPAPropertyConverter.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JPAPropertyConverter.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/JPAPropertyConverter.java Wed Feb 19 15:47:58 2014
@@ -29,7 +29,7 @@ public final class JPAPropertyConverter
private String key;
private String value;
- public Pair(String key, String value) {
+ public Pair(final String key, final String value) {
this.key = key;
this.value = value;
}
@@ -49,7 +49,7 @@ public final class JPAPropertyConverter
}
// TODO: manage more properties
- public static Pair toOpenJPAValue(String key, String value, Properties properties) {
+ public static Pair toOpenJPAValue(final String key, final String value, final Properties properties) {
if (!SystemInstance.get().getOptions().get("openejb.convert-jpa-properties", false)) {
return null;
}