Skip to content

Commit

Permalink
WFLY-4218 Fix EJB3 Compiler Warnings
Browse files Browse the repository at this point in the history
The EJB3 subsystem contains quite a few compiler warnings that are easy
to fix (raw types, unused imports, unused variables, deprecated code).

Issue: WFLY-4218
https://issues.jboss.org/browse/WFLY-4218
  • Loading branch information
marschall authored and bstansberry committed Feb 10, 2015
1 parent 7b37dd3 commit 7a4c683
Show file tree
Hide file tree
Showing 64 changed files with 148 additions and 281 deletions.
Expand Up @@ -23,6 +23,7 @@


import org.glassfish.enterprise.concurrent.AbstractManagedExecutorService; import org.glassfish.enterprise.concurrent.AbstractManagedExecutorService;
import org.glassfish.enterprise.concurrent.ContextServiceImpl; import org.glassfish.enterprise.concurrent.ContextServiceImpl;
import org.glassfish.enterprise.concurrent.ManagedExecutorServiceAdapter;
import org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl; import org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl;
import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext;
Expand Down Expand Up @@ -66,7 +67,7 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod
final AbstractManagedExecutorService.RejectPolicy rejectPolicy = AbstractManagedExecutorService.RejectPolicy.valueOf(ManagedExecutorServiceResourceDefinition.REJECT_POLICY_AD.resolveModelAttribute(context, model).asString()); final AbstractManagedExecutorService.RejectPolicy rejectPolicy = AbstractManagedExecutorService.RejectPolicy.valueOf(ManagedExecutorServiceResourceDefinition.REJECT_POLICY_AD.resolveModelAttribute(context, model).asString());


final ManagedExecutorServiceService service = new ManagedExecutorServiceService(name, jndiName, hungTaskThreshold, longRunningTasks, coreThreads, maxThreads, keepAliveTime, keepAliveTimeUnit, threadLifeTime, queueLength, rejectPolicy); final ManagedExecutorServiceService service = new ManagedExecutorServiceService(name, jndiName, hungTaskThreshold, longRunningTasks, coreThreads, maxThreads, keepAliveTime, keepAliveTimeUnit, threadLifeTime, queueLength, rejectPolicy);
final ServiceBuilder serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedExecutorServiceServiceName(name), service); final ServiceBuilder<ManagedExecutorServiceAdapter> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedExecutorServiceServiceName(name), service);


boolean rcPresent = context.getOriginalRootResource().hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, RequestControllerExtension.SUBSYSTEM_NAME)); boolean rcPresent = context.getOriginalRootResource().hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, RequestControllerExtension.SUBSYSTEM_NAME));
String contextService = null; String contextService = null;
Expand Down
Expand Up @@ -21,8 +21,11 @@
*/ */
package org.jboss.as.ee.subsystem; package org.jboss.as.ee.subsystem;


import java.util.concurrent.TimeUnit;

import org.glassfish.enterprise.concurrent.AbstractManagedExecutorService; import org.glassfish.enterprise.concurrent.AbstractManagedExecutorService;
import org.glassfish.enterprise.concurrent.ContextServiceImpl; import org.glassfish.enterprise.concurrent.ContextServiceImpl;
import org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceAdapter;
import org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl; import org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl;
import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext;
Expand All @@ -37,8 +40,6 @@
import org.wildfly.extension.requestcontroller.RequestController; import org.wildfly.extension.requestcontroller.RequestController;
import org.wildfly.extension.requestcontroller.RequestControllerExtension; import org.wildfly.extension.requestcontroller.RequestControllerExtension;


import java.util.concurrent.TimeUnit;

/** /**
* @author Eduardo Martins * @author Eduardo Martins
*/ */
Expand Down Expand Up @@ -67,7 +68,7 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod
final AbstractManagedExecutorService.RejectPolicy rejectPolicy = AbstractManagedExecutorService.RejectPolicy.valueOf(ManagedScheduledExecutorServiceResourceDefinition.REJECT_POLICY_AD.resolveModelAttribute(context, model).asString()); final AbstractManagedExecutorService.RejectPolicy rejectPolicy = AbstractManagedExecutorService.RejectPolicy.valueOf(ManagedScheduledExecutorServiceResourceDefinition.REJECT_POLICY_AD.resolveModelAttribute(context, model).asString());


final ManagedScheduledExecutorServiceService service = new ManagedScheduledExecutorServiceService(name, jndiName, hungTaskThreshold, longRunningTasks, coreThreads, keepAliveTime, keepAliveTimeUnit, threadLifeTime, rejectPolicy); final ManagedScheduledExecutorServiceService service = new ManagedScheduledExecutorServiceService(name, jndiName, hungTaskThreshold, longRunningTasks, coreThreads, keepAliveTime, keepAliveTimeUnit, threadLifeTime, rejectPolicy);
final ServiceBuilder serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedScheduledExecutorServiceServiceName(name), service); final ServiceBuilder<ManagedScheduledExecutorServiceAdapter> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedScheduledExecutorServiceServiceName(name), service);


String contextService = null; String contextService = null;
if(model.hasDefined(ManagedScheduledExecutorServiceResourceDefinition.CONTEXT_SERVICE)) { if(model.hasDefined(ManagedScheduledExecutorServiceResourceDefinition.CONTEXT_SERVICE)) {
Expand Down
Expand Up @@ -22,6 +22,7 @@
package org.jboss.as.ee.subsystem; package org.jboss.as.ee.subsystem;


import org.glassfish.enterprise.concurrent.ContextServiceImpl; import org.glassfish.enterprise.concurrent.ContextServiceImpl;
import org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl;
import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationFailedException;
Expand Down Expand Up @@ -51,7 +52,7 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod
final int priority = ManagedThreadFactoryResourceDefinition.PRIORITY_AD.resolveModelAttribute(context, model).asInt(); final int priority = ManagedThreadFactoryResourceDefinition.PRIORITY_AD.resolveModelAttribute(context, model).asInt();


final ManagedThreadFactoryService service = new ManagedThreadFactoryService(name, jndiName, priority); final ManagedThreadFactoryService service = new ManagedThreadFactoryService(name, jndiName, priority);
final ServiceBuilder serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedThreadFactoryServiceName(name), service); final ServiceBuilder<ManagedThreadFactoryImpl> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedThreadFactoryServiceName(name), service);
String contextService = null; String contextService = null;
if(model.hasDefined(ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE)) { if(model.hasDefined(ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE)) {
contextService = ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString(); contextService = ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString();
Expand Down
Expand Up @@ -52,7 +52,6 @@
import org.jboss.invocation.InterceptorFactoryContext; import org.jboss.invocation.InterceptorFactoryContext;
import org.jboss.invocation.Interceptors; import org.jboss.invocation.Interceptors;
import org.jboss.invocation.proxy.MethodIdentifier; import org.jboss.invocation.proxy.MethodIdentifier;
import org.jboss.logging.Logger;
import org.jboss.msc.value.CachedValue; import org.jboss.msc.value.CachedValue;
import org.jboss.msc.value.ConstructedValue; import org.jboss.msc.value.ConstructedValue;
import org.jboss.msc.value.Value; import org.jboss.msc.value.Value;
Expand All @@ -79,8 +78,7 @@
*/ */
public class EJBContainerInterceptorsViewConfigurator implements ViewConfigurator { public class EJBContainerInterceptorsViewConfigurator implements ViewConfigurator {


private static final Logger logger = Logger.getLogger(EJBContainerInterceptorsViewConfigurator.class); private static final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];


public static final EJBContainerInterceptorsViewConfigurator INSTANCE = new EJBContainerInterceptorsViewConfigurator(); public static final EJBContainerInterceptorsViewConfigurator INSTANCE = new EJBContainerInterceptorsViewConfigurator();


Expand Down Expand Up @@ -233,7 +231,6 @@ private class InterceptorClassDescriptionTraversal extends ClassDescriptionTrave
private final EJBComponentDescription ejbComponentDescription; private final EJBComponentDescription ejbComponentDescription;
private final DeploymentReflectionIndex deploymentReflectionIndex; private final DeploymentReflectionIndex deploymentReflectionIndex;
private final Class<?> interceptorClass; private final Class<?> interceptorClass;
private final String interceptorClassName;


private final List<InterceptorFactory> aroundInvokeInterceptorFactories = new ArrayList<InterceptorFactory>(); private final List<InterceptorFactory> aroundInvokeInterceptorFactories = new ArrayList<InterceptorFactory>();
private final List<InterceptorFactory> aroundTimeoutInterceptorFactories = new ArrayList<InterceptorFactory>(); private final List<InterceptorFactory> aroundTimeoutInterceptorFactories = new ArrayList<InterceptorFactory>();
Expand All @@ -247,7 +244,6 @@ private class InterceptorClassDescriptionTraversal extends ClassDescriptionTrave
this.deploymentReflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX); this.deploymentReflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX);
this.moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); this.moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
this.interceptorClass = interceptorClass; this.interceptorClass = interceptorClass;
this.interceptorClassName = interceptorClass.getName();


} }


Expand Down
Expand Up @@ -170,14 +170,6 @@ public DeniedSyncMethodKey(CurrentSynchronizationCallback.CallbackType callbackT
this.methodType = methodType; this.methodType = methodType;
} }


public CurrentSynchronizationCallback.CallbackType getCallbackType() {
return callbackType;
}

public MethodType getMethodType() {
return methodType;
}

@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
Expand Down
Expand Up @@ -62,7 +62,7 @@ public class EntityBeanComponent extends EJBComponent implements PooledComponent
private final Class<EJBLocalHome> localHomeClass; private final Class<EJBLocalHome> localHomeClass;
private final Class<EJBLocalObject> localClass; private final Class<EJBLocalObject> localClass;
private final Class<EJBObject> remoteClass; private final Class<EJBObject> remoteClass;
private final Class<Object> primaryKeyClass; private final Class<?> primaryKeyClass;
private final Boolean optimisticLocking; private final Boolean optimisticLocking;


private final Method ejbStoreMethod; private final Method ejbStoreMethod;
Expand Down Expand Up @@ -201,7 +201,7 @@ public Class<EJBObject> getRemoteClass() {
return remoteClass; return remoteClass;
} }


public Class<Object> getPrimaryKeyClass() { public Class<?> getPrimaryKeyClass() {
return primaryKeyClass; return primaryKeyClass;
} }


Expand Down
Expand Up @@ -55,7 +55,7 @@ public class EntityBeanComponentCreateService extends EJBComponentCreateService
private final Class<EJBLocalHome> localHomeClass; private final Class<EJBLocalHome> localHomeClass;
private final Class<EJBObject> remoteClass; private final Class<EJBObject> remoteClass;
private final Class<EJBLocalObject> localClass; private final Class<EJBLocalObject> localClass;
private final Class<Object> primaryKeyClass; private final Class<?> primaryKeyClass;
private final Method ejbStoreMethod; private final Method ejbStoreMethod;
private final Method ejbLoadMethod; private final Method ejbLoadMethod;
private final Method ejbActivateMethod; private final Method ejbActivateMethod;
Expand All @@ -80,7 +80,7 @@ public EntityBeanComponentCreateService(final ComponentConfiguration componentCo
localHomeClass = (Class<EJBLocalHome>) load(classLoader, beanMetaData.getLocalHome()); localHomeClass = (Class<EJBLocalHome>) load(classLoader, beanMetaData.getLocalHome());
localClass = (Class<EJBLocalObject>) load(classLoader, beanMetaData.getLocal()); localClass = (Class<EJBLocalObject>) load(classLoader, beanMetaData.getLocal());
remoteClass = (Class<EJBObject>) load(classLoader, beanMetaData.getRemote()); remoteClass = (Class<EJBObject>) load(classLoader, beanMetaData.getRemote());
primaryKeyClass = (Class<Object>) load(classLoader, beanMetaData.getPrimKeyClass()); primaryKeyClass = (Class<?>) load(classLoader, beanMetaData.getPrimKeyClass());


final ClassLoader classLoader1 = componentConfiguration.getModuleClassLoader(); final ClassLoader classLoader1 = componentConfiguration.getModuleClassLoader();
final InterceptorFactory tcclInterceptorFactory = new ImmediateInterceptorFactory(new ContextClassLoaderInterceptor(classLoader1)); final InterceptorFactory tcclInterceptorFactory = new ImmediateInterceptorFactory(new ContextClassLoaderInterceptor(classLoader1));
Expand Down Expand Up @@ -174,7 +174,7 @@ public Class<EJBLocalObject> getLocalClass() {
return localClass; return localClass;
} }


public Class<Object> getPrimaryKeyClass() { public Class<?> getPrimaryKeyClass() {
return primaryKeyClass; return primaryKeyClass;
} }


Expand Down
Expand Up @@ -102,7 +102,7 @@ public Object processInvocation(final InterceptorContext context) throws Excepti
protected Object prepareResults(final InterceptorContext context, final Object result, final EntityBeanComponent component) throws Exception { protected Object prepareResults(final InterceptorContext context, final Object result, final EntityBeanComponent component) throws Exception {
switch (returnType) { switch (returnType) {
case COLLECTION: { case COLLECTION: {
Collection keys = (Collection) result; Collection<?> keys = (Collection<?>) result;
final Set<Object> results = new LinkedHashSet<Object>(); final Set<Object> results = new LinkedHashSet<Object>();
if (keys != null) { if (keys != null) {
for (Object key : keys) { for (Object key : keys) {
Expand All @@ -112,7 +112,7 @@ protected Object prepareResults(final InterceptorContext context, final Object r
return results; return results;
} }
case ENUMERATION: { case ENUMERATION: {
Enumeration keys = (Enumeration) result; Enumeration<?> keys = (Enumeration<?>) result;
final Set<Object> results = new LinkedHashSet<Object>(); final Set<Object> results = new LinkedHashSet<Object>();
if (keys != null) { if (keys != null) {
while (keys.hasMoreElements()) { while (keys.hasMoreElements()) {
Expand Down
Expand Up @@ -59,7 +59,6 @@ public Object processInvocation(final InterceptorContext context) throws Excepti


//grab a bean from the pool to invoke the business method on //grab a bean from the pool to invoke the business method on
final EntityBeanComponentInstance instance = component.acquireUnAssociatedInstance(); final EntityBeanComponentInstance instance = component.acquireUnAssociatedInstance();
final Object result;
final InvocationType invocationType = context.getPrivateData(InvocationType.class); final InvocationType invocationType = context.getPrivateData(InvocationType.class);
try { try {
context.putPrivateData(InvocationType.class, InvocationType.HOME_METHOD); context.putPrivateData(InvocationType.class, InvocationType.HOME_METHOD);
Expand Down
Expand Up @@ -34,7 +34,7 @@
* *
* @author Stuart Douglas * @author Stuart Douglas
*/ */
public abstract class AsyncInvocationTask implements Runnable, Future { public abstract class AsyncInvocationTask implements Runnable, Future<Object> {
private final CancellationFlag cancelledFlag; private final CancellationFlag cancelledFlag;


private volatile boolean running = false; private volatile boolean running = false;
Expand Down
Expand Up @@ -27,7 +27,6 @@


import javax.resource.ResourceException; import javax.resource.ResourceException;
import javax.resource.spi.ActivationSpec; import javax.resource.spi.ActivationSpec;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.endpoint.MessageEndpointFactory; import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;


Expand Down Expand Up @@ -67,10 +66,8 @@ public class MessageDrivenComponent extends EJBComponent implements PooledCompon
private final SuspendController suspendController; private final SuspendController suspendController;
private final ActivationSpec activationSpec; private final ActivationSpec activationSpec;
private final MessageEndpointFactory endpointFactory; private final MessageEndpointFactory endpointFactory;
private final Class<?> messageListenerInterface;
private final ClassLoader classLoader; private final ClassLoader classLoader;
private volatile boolean deliveryActive; private volatile boolean deliveryActive;
private ResourceAdapter resourceAdapter;
private Endpoint endpoint; private Endpoint endpoint;
private String activationName; private String activationName;


Expand All @@ -92,11 +89,6 @@ public void preSuspend(ServerActivityCallback listener) {
listener.done(); listener.done();
} }


@Deprecated
public void suspened(ServerActivityCallback listener) {
suspended(listener);
}

public void suspended(ServerActivityCallback listener) { public void suspended(ServerActivityCallback listener) {
listener.done(); listener.done();
} }
Expand Down Expand Up @@ -142,7 +134,6 @@ public void destroy(MessageDrivenComponentInstance obj) {
this.classLoader = ejbComponentCreateService.getModuleClassLoader(); this.classLoader = ejbComponentCreateService.getModuleClassLoader();
this.suspendController = ejbComponentCreateService.getSuspendControllerInjectedValue().getValue(); this.suspendController = ejbComponentCreateService.getSuspendControllerInjectedValue().getValue();
this.activationSpec = activationSpec; this.activationSpec = activationSpec;
this.messageListenerInterface = messageListenerInterface;
final ClassLoader componentClassLoader = doPrivileged(new GetClassLoaderAction(ejbComponentCreateService.getComponentClass())); final ClassLoader componentClassLoader = doPrivileged(new GetClassLoaderAction(ejbComponentCreateService.getComponentClass()));
final MessageEndpointService<?> service = new MessageEndpointService<Object>() { final MessageEndpointService<?> service = new MessageEndpointService<Object>() {
@Override @Override
Expand Down Expand Up @@ -204,10 +195,6 @@ public String getPoolName() {
return poolName; return poolName;
} }


protected void setResourceAdapter(ResourceAdapter resourceAdapter) {
this.resourceAdapter = resourceAdapter;
}

void setEndpoint(final Endpoint endpoint) { void setEndpoint(final Endpoint endpoint) {
this.endpoint = endpoint; this.endpoint = endpoint;
} }
Expand Down
Expand Up @@ -99,9 +99,6 @@ protected BasicComponent createComponent() {


final ActivationSpec activationSpec = getEndpointDeployer().createActivationSpecs(activeResourceAdapterName, messageListenerInterface, activationProps, getDeploymentClassLoader()); final ActivationSpec activationSpec = getEndpointDeployer().createActivationSpecs(activeResourceAdapterName, messageListenerInterface, activationProps, getDeploymentClassLoader());
final MessageDrivenComponent component = new MessageDrivenComponent(this, messageListenerInterface, activationSpec, deliveryActive); final MessageDrivenComponent component = new MessageDrivenComponent(this, messageListenerInterface, activationSpec, deliveryActive);
// set the resource adapter
final ResourceAdapter resourceAdapter = this.resourceAdapterInjectedValue.getValue();
component.setResourceAdapter(resourceAdapter);
// set the endpoint // set the endpoint
final EJBUtilities ejbUtilities = this.ejbUtilitiesInjectedValue.getValue(); final EJBUtilities ejbUtilities = this.ejbUtilitiesInjectedValue.getValue();
final Endpoint endpoint = ejbUtilities.getEndpoint(activeResourceAdapterName); final Endpoint endpoint = ejbUtilities.getEndpoint(activeResourceAdapterName);
Expand Down
Expand Up @@ -42,7 +42,6 @@
import org.jboss.as.ee.component.serialization.WriteReplaceInterface; import org.jboss.as.ee.component.serialization.WriteReplaceInterface;
import org.jboss.as.ee.metadata.MetadataCompleteMarker; import org.jboss.as.ee.metadata.MetadataCompleteMarker;
import org.jboss.as.ejb3.logging.EjbLogger; import org.jboss.as.ejb3.logging.EjbLogger;
import org.jboss.as.ejb3.component.DefaultAccessTimeoutService;
import org.jboss.as.ejb3.component.EJBViewDescription; import org.jboss.as.ejb3.component.EJBViewDescription;
import org.jboss.as.ejb3.component.MethodIntf; import org.jboss.as.ejb3.component.MethodIntf;
import org.jboss.as.ejb3.component.interceptors.ComponentTypeIdentityInterceptorFactory; import org.jboss.as.ejb3.component.interceptors.ComponentTypeIdentityInterceptorFactory;
Expand Down Expand Up @@ -78,8 +77,6 @@ public class SingletonComponentDescription extends SessionBeanComponentDescripti


private final List<ServiceName> dependsOn = new ArrayList<ServiceName>(); private final List<ServiceName> dependsOn = new ArrayList<ServiceName>();


private DefaultAccessTimeoutService defaultAccessTimeoutProvider;

/** /**
* Construct a new instance. * Construct a new instance.
* *
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.jboss.as.ejb3.logging.EjbLogger; import org.jboss.as.ejb3.logging.EjbLogger;
import org.jboss.invocation.Interceptor; import org.jboss.invocation.Interceptor;
import org.jboss.invocation.InterceptorContext; import org.jboss.invocation.InterceptorContext;
import org.jboss.logging.Logger;


import javax.ejb.LockType; import javax.ejb.LockType;
import javax.interceptor.InvocationContext; import javax.interceptor.InvocationContext;
Expand All @@ -40,11 +39,6 @@
*/ */
public class ContainerManagedConcurrencyInterceptor implements Interceptor { public class ContainerManagedConcurrencyInterceptor implements Interceptor {


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

/** /**
* A spec compliant {@link org.jboss.as.ejb3.concurrency.EJBReadWriteLock} * A spec compliant {@link org.jboss.as.ejb3.concurrency.EJBReadWriteLock}
*/ */
Expand Down
Expand Up @@ -38,10 +38,6 @@ public static InterceptorContext get() {
return current; return current;
} }


public static <T extends InterceptorContext> T get(Class<T> expectedType) {
return expectedType.cast(get());
}

public static EJBContextImpl getEjbContext() { public static EJBContextImpl getEjbContext() {
final InterceptorContext context = get(); final InterceptorContext context = get();
if(context == null) { if(context == null) {
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor; import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.server.deployment.annotation.CompositeIndex; import org.jboss.as.server.deployment.annotation.CompositeIndex;
import org.jboss.logging.Logger;
import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData; import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;


/** /**
Expand All @@ -34,7 +33,7 @@
* @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a> * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
*/ */
public class AnnotatedEJBComponentDescriptionDeploymentUnitProcessor extends AbstractDeploymentUnitProcessor implements DeploymentUnitProcessor { public class AnnotatedEJBComponentDescriptionDeploymentUnitProcessor extends AbstractDeploymentUnitProcessor implements DeploymentUnitProcessor {
private static final Logger logger = Logger.getLogger(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.class);
private final EJBComponentDescriptionFactory[] factories; private final EJBComponentDescriptionFactory[] factories;


/** /**
Expand Down
Expand Up @@ -21,25 +21,23 @@
*/ */
package org.jboss.as.ejb3.deployment.processors; package org.jboss.as.ejb3.deployment.processors;


import static org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.getEjbJarDescription;

import org.jboss.as.ee.component.Attachments; import org.jboss.as.ee.component.Attachments;
import org.jboss.as.ejb3.component.EJBComponentDescription; import org.jboss.as.ejb3.component.EJBComponentDescription;
import org.jboss.as.ejb3.deployment.EjbDeploymentAttachmentKeys; import org.jboss.as.ejb3.deployment.EjbDeploymentAttachmentKeys;
import org.jboss.as.ejb3.deployment.EjbJarDescription; import org.jboss.as.ejb3.deployment.EjbJarDescription;
import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.annotation.CompositeIndex; import org.jboss.as.server.deployment.annotation.CompositeIndex;
import org.jboss.logging.Logger;
import org.jboss.metadata.ejb.spec.EjbJarMetaData; import org.jboss.metadata.ejb.spec.EjbJarMetaData;
import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData; import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData; import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData;


import static org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.getEjbJarDescription;

/** /**
* @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a> * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
*/ */
public abstract class EJBComponentDescriptionFactory { public abstract class EJBComponentDescriptionFactory {
private static final Logger logger = Logger.getLogger(EJBComponentDescriptionFactory.class);


/** /**
* If this is an appclient we want to make the components as not installable, so we can still look up which EJB's are in * If this is an appclient we want to make the components as not installable, so we can still look up which EJB's are in
Expand Down
Expand Up @@ -103,7 +103,7 @@ public void undeploy(DeploymentUnit deploymentUnit) {
private void installManagementResource(ComponentConfiguration configuration, DeploymentUnit deploymentUnit) { private void installManagementResource(ComponentConfiguration configuration, DeploymentUnit deploymentUnit) {
final EJBComponentType type = EJBComponentType.getComponentType(configuration); final EJBComponentType type = EJBComponentType.getComponentType(configuration);
PathAddress addr = getComponentAddress(type, configuration, deploymentUnit); PathAddress addr = getComponentAddress(type, configuration, deploymentUnit);
final AbstractEJBComponentRuntimeHandler handler = type.getRuntimeHandler(); final AbstractEJBComponentRuntimeHandler<?> handler = type.getRuntimeHandler();
handler.registerComponent(addr, configuration.getComponentDescription().getStartServiceName()); handler.registerComponent(addr, configuration.getComponentDescription().getStartServiceName());
deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS, new InstalledComponent(type, addr)); deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS, new InstalledComponent(type, addr));
deploymentUnit.createDeploymentSubModel(EJB3Extension.SUBSYSTEM_NAME, addr.getLastElement()); deploymentUnit.createDeploymentSubModel(EJB3Extension.SUBSYSTEM_NAME, addr.getLastElement());
Expand Down
Expand Up @@ -203,7 +203,6 @@ private class EJBResourceWrapper {
private final String beanInterface; private final String beanInterface;
private final String beanName; private final String beanName;
private final String lookup; private final String lookup;
private final String description;
private final PropertyReplacer propertyReplacer; private final PropertyReplacer propertyReplacer;


public EJBResourceWrapper(AnnotationInstance annotation, PropertyReplacer propertyReplacer) { public EJBResourceWrapper(AnnotationInstance annotation, PropertyReplacer propertyReplacer) {
Expand All @@ -217,7 +216,6 @@ public EJBResourceWrapper(AnnotationInstance annotation, PropertyReplacer proper
lookupValue = stringValueOrNull(annotation, "mappedName"); lookupValue = stringValueOrNull(annotation, "mappedName");
} }
this.lookup = lookupValue; this.lookup = lookupValue;
description = stringValueOrNull(annotation, "description");
} }


private String name() { private String name() {
Expand All @@ -236,10 +234,6 @@ private String lookup() {
return lookup; return lookup;
} }


private String description() {
return description;
}

private String stringValueOrNull(final AnnotationInstance annotation, final String attribute) { private String stringValueOrNull(final AnnotationInstance annotation, final String attribute) {
final AnnotationValue value = annotation.value(attribute); final AnnotationValue value = annotation.value(attribute);
return (value != null) ? propertyReplacer.replaceProperties(value.asString()) : null; return (value != null) ? propertyReplacer.replaceProperties(value.asString()) : null;
Expand Down

0 comments on commit 7a4c683

Please sign in to comment.